add alersts api
This commit is contained in:
@@ -196,5 +196,14 @@ class LoanOrder extends Model
|
||||
|
||||
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,
|
||||
]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user