Package Data | |
---|---|
Maintainer Username: | stevenmaguire |
Maintainer Contact: | stevenmaguire@gmail.com (Steven Maguire) |
Package Create Date: | 2015-10-21 |
Package Last Update: | 2015-10-29 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-19 03:04:19 |
Package Statistics | |
---|---|
Total Downloads: | 45 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Create non-incrementing models whose primary key is a UUID.
Via Composer
$ composer require stevenmaguire/laravel-uuid-model
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.
$ ./vendor/bin/phpunit
Please see CONTRIBUTING for details.
If you discover any security related issues, please email stevenmaguire@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.