stevenmaguire/laravel-uuid-model
最新稳定版本:0.1.0
Composer 安装命令:
composer require stevenmaguire/laravel-uuid-model
包简介
Create non-incrementing Laravel models whose primary key is a UUID
README 文档
README
Create non-incrementing models whose primary key is a UUID.
Install
Via Composer
$ composer require stevenmaguire/laravel-uuid-model
Usage
Extend the UuidModel
class User extends Stevenmaguire\Laravel\UuidModel { // }
By default any model that extends the UuidModel will automatically assign a random UUID value to the primaryKey while creating.
To include custom "UUID attributes", each model that extends the UuidModel can declare those attributes as an array value for the uuidAttributes property.
class User extends Stevenmaguire\Laravel\UuidModel { /** * Auto-assigned uuid model attributes. * * @var array */ public $uuidAttributes = ['foo', 'bar']; }
This will result in the model's primary key, id, foo, and bar all being automatically assigned a random UUID value.
Testing
$ ./vendor/bin/phpunit
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email stevenmaguire@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 46
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-21