jamesh/laravel-uuid
最新稳定版本:2.0.1
Composer 安装命令:
composer require jamesh/laravel-uuid
包简介
Eloquent UUID Trait for Laravel 6 and above.
README 文档
README
Eloquent UUID Trait for Laravel 5.7 and above.
⚠️ This package will no longer be maintained. The HasUuids feature has been added in Laravel 9.
The HasUuid Trait will add behavior to creating and saving Eloquent events for generate an Uuid.
Installation
composer require jamesh/laravel-uuid
Usage
In your migrations
Schema::create('users', function (Blueprint $table) { $table->uuid('id')->primary(); // Create CHAR(36) $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); $table->rememberToken(); $table->timestamps(); });
In your models
<?php namespace App; use Illuminate\Database\Eloquent\Model; use Jamesh\Uuid\HasUuid; class User extends Model { use HasUuid; }
Unit tests
To run the tests, just run composer install and composer test.
统计信息
- 总下载量: 60.09k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 21
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-27