Download the PHP package kadevland/simple-laravel-eloquent-uuid without Composer
On this page you can find all versions of the php package kadevland/simple-laravel-eloquent-uuid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kadevland/simple-laravel-eloquent-uuid
More information about kadevland/simple-laravel-eloquent-uuid
Files in kadevland/simple-laravel-eloquent-uuid
Package simple-laravel-eloquent-uuid
Short Description A simple Trait provides the ability to use UUID generator in your Eloquent models
License MIT
Homepage https://github.com/kadevland/simple-laravel-eloquent-uuid
Informations about the package simple-laravel-eloquent-uuid
simple-laravel-eloquent-uuid
A simple Trait to provide UUID support for your Eloquent models
A simple, automatic UUID generator for any model based on Laravel 7 and above, By using this package when each new entry you will get the following :
- Generate
uuid
automatically . - Assign it to
uuid
field in database automatically. - easy find it based
uuid
method.
Installation
You can install the package via Composer:
Usage
There are two ways to use this package:
- with
uuid
in string formatKadevland\Eloquent\Uuid\Traits\HasUuid
- with
uuid
in bytes formatKadevland\Eloquent\Uuid\Traits\HasByteUuid
Import trait and set key type string or uuid if use string format.
By default UUID versions is v4
You can also specify v1 UUIDs to be used by setting in config file.
Uuid string format
Models
Use the HasUuid trait:
Uuid bytes format
Models
Use the HasByteUuid trait:
Config
You can publish the config file with:
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
License
The MIT License (MIT). Please see License File for more information.