starmoozie / id-generator
laravel generate custom ID
Installs: 41
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/starmoozie/id-generator
Requires
- php: >=5.6.0
This package is auto-updated.
Last update: 2025-09-22 02:56:24 UTC
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