starmoozie/id-generator
Composer 安装命令:
composer require starmoozie/id-generator
包简介
laravel generate custom ID
README 文档
README
How to
Generate increment custom id pada laravel
# Tambahkan pada model use Starmoozie\IdGenerator\IdGenerator; public static function boot() { parent::boot(); self::creating(function ($model) { $config = ['table' => $this->table, 'length' => 12, 'prefix' =>date('ymd')]; $model->id = IdGenerator::generate($config); }); } # Hasil 200124000001 200124000002 200124000003 200124000004 ............
SQL Support
- Mysql
- PostgreSQL
统计信息
- 总下载量: 41
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-17