kduma/eloquent-ulidable
最新稳定版本:v1.0.0
Composer 安装命令:
composer require kduma/eloquent-ulidable
包简介
Eases using and generating ulid's in Laravel Eloquent models.
关键字:
README 文档
README
Eases using and generating ulid's in Laravel Eloquent models.
Check full documentation here: opensource.duma.sh/libraries/php/eloquent-ulidable
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. (whereUlidis query scope)
Packagist
View this package on Packagist.org: kduma/eloquent-ulidable
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-26