laravolt/eloquent-uuid 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laravolt/eloquent-uuid

Composer 安装命令:

composer require laravolt/eloquent-uuid

包简介

Universally Unique Identifier (UUID) for Laravel Eloquent

README 文档

README

Generate UUID automatically when creating/inserting new data.

Install

Via Composer

$ composer require laravolt/eloquent-uuid

Then register the service provider, head over your config/app.php file and add the following line into the providers array:

Laravolt\Database\Eloquent\UuidServiceProvider::class,

Usage

Create/Alter Database Table Column Type

Schema::create('users', function (Blueprint $table) {
    
    // Create UUID column
    $table->char('id', 32)->primary();

    $table->string('name');
});

Implement in Eloquent Model

<?php

namespace App;

use Laravolt\Contracts\Eloquent\Uuid as UuidContract;
use Laravolt\Database\Eloquent\Uuid;

class Book extends Model implements UuidContract
{
    use Uuid;

    // Uuid Columns
    protected $uuid = ['id'];

统计信息

  • 总下载量: 1.3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固