mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
fix filament resource notify
This commit is contained in:
@@ -17,7 +17,7 @@ class CreateExam extends CreateRecord
|
||||
$examRep = new ExamRepository();
|
||||
try {
|
||||
$this->record = $examRep->store($data);
|
||||
$this->notify('success', $this->getCreatedNotificationTitle());
|
||||
send_admin_success_notification();
|
||||
if ($another) {
|
||||
// Ensure that the form record is anonymized so that relationships aren't loaded.
|
||||
$this->form->model($this->record::class);
|
||||
@@ -30,7 +30,7 @@ class CreateExam extends CreateRecord
|
||||
$this->redirect($this->getResource()::getUrl('index'));
|
||||
} catch (\Exception $exception) {
|
||||
do_log($exception->getMessage() . "\n" . $exception->getTraceAsString(), "error");
|
||||
$this->notify('danger', $exception->getMessage());
|
||||
send_admin_fail_notification($exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@ class EditExam extends EditRecord
|
||||
$examRep = new ExamRepository();
|
||||
try {
|
||||
$this->record = $examRep->update($data, $this->record->id);
|
||||
$this->notify('success', $this->getSavedNotificationTitle());
|
||||
send_admin_success_notification();
|
||||
$this->redirect($this->getResource()::getUrl('index'));
|
||||
} catch (\Exception $exception) {
|
||||
$this->notify('danger', $exception->getMessage());
|
||||
send_admin_fail_notification($exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user