boot
This commit is contained in:
parent
d9a66e19be
commit
e242d2aa04
@ -38,15 +38,15 @@ class Facilitator extends Model
|
||||
];
|
||||
|
||||
// Boot method untuk otomatis mengisi UUID saat create
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
static::creating(function ($model) {
|
||||
if (empty($model->id)) {
|
||||
$model->id = (string) Str::uuid();
|
||||
}
|
||||
});
|
||||
}
|
||||
// protected static function boot()
|
||||
// {
|
||||
// parent::boot();
|
||||
// static::creating(function ($model) {
|
||||
// if (empty($model->id)) {
|
||||
// $model->id = (string) Str::uuid();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// Jika ingin menggunakan created_date dari JSON sebagai pengganti created_at Laravel
|
||||
const CREATED_AT = 'created_date';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user