add alersts api

This commit is contained in:
nurmuhammet committed 2024-11-26 01:16:49 +05:00
1 parent 55060d1ad2
commit 5d5e269285
6 files changed
+116 -1

No files matched your search

+9
View File
@@ -196,5 +196,14 @@ protected static function boot()
static::creating(LoanOrderRepo::creating());
static::created(LoanOrderRepo::created());
static::updated(function (LoanOrder $model) {
info($model->notes);
if ($model->notes && $model->wasChanged('notes')) {
auth()->user()->alerts()->create([
'name' => 'Duýdyryş',
'value' => $model->notes,
]);
}
});
}
}