This commit is contained in:
fauzgabriel@gmail.com 2026-04-13 14:20:47 +07:00
parent d9a66e19be
commit e242d2aa04

View File

@ -38,15 +38,15 @@ class Facilitator extends Model
]; ];
// Boot method untuk otomatis mengisi UUID saat create // Boot method untuk otomatis mengisi UUID saat create
protected static function boot() // protected static function boot()
{ // {
parent::boot(); // parent::boot();
static::creating(function ($model) { // static::creating(function ($model) {
if (empty($model->id)) { // if (empty($model->id)) {
$model->id = (string) Str::uuid(); // $model->id = (string) Str::uuid();
} // }
}); // });
} // }
// Jika ingin menggunakan created_date dari JSON sebagai pengganti created_at Laravel // Jika ingin menggunakan created_date dari JSON sebagai pengganti created_at Laravel
const CREATED_AT = 'created_date'; const CREATED_AT = 'created_date';