Download the PHP package kduma/eloquent-ulidable without Composer
On this page you can find all versions of the php package kduma/eloquent-ulidable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package eloquent-ulidable
L5-eloquent-ulidable
Eases using and generating ulid's in Laravel Eloquent models.
Setup
Install it using composer
composer require kduma/eloquent-ulidable
Prepare models
Inside your model (not on top of file) add following lines:
use \KDuma\Eloquent\Ulidable;
In database create ulid
string field. If you use migrations, you can use following snippet:
$table->ulid()->unique();
Usage
By default, it generates slug on first save.
$model->regenerateUlid()
- Generate new ulid. (Remember to save it by yourself)Model::whereUlid($ulid)->first()
- Find by ulid. (whereUlid
is query scope)
Packagist
View this package on Packagist.org: kduma/eloquent-ulidable
All versions of eloquent-ulidable with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
The package kduma/eloquent-ulidable contains the following files
Loading the files please wait ....