Download the PHP package frictionlessdigital/uuidable without Composer
On this page you can find all versions of the php package frictionlessdigital/uuidable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download frictionlessdigital/uuidable
More information about frictionlessdigital/uuidable
Files in frictionlessdigital/uuidable
Package uuidable
Short Description Frictionless Solutions | Uuidable
License MIT
Informations about the package uuidable
FLS :: Uuidable
Add UUID behavior to your Eloquent models.
Installation
Note that root namespace for the package is Fls
not Frictionlessditial
.
Config
The package does not require configuration.
Integration
To add behavior to your model, simply import the trait:
If you want to update the field to within which the UUID is stored, define a static model propery like so:
Usage
Fls\Uuidable\Uuidable
trait adds a number of methods to your model:
Uuidable::findByUuid
Similar to find($key)
, findByUuid($uuid)
will locate the first Uuidable model where the value of the fild matches the argument.
You can also pass an array of column you want to hydrate from the database as a second argument:
Under the hood the method relies on whereUuid()
Uuidable::whereUuid()
Scope the model by uuid value. You can use a string value, an array, pass in Arrayable class. N.B. if you pass an Eloquent Collection, it will be parsed for its model keys, which will be passed as a scoping argument.
or
or
or
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
Contributing
Please see CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Cyrill N Kalita
- All Contributors
License
The MIT License (MIT). Please see License File for more information.