Notification after successful edit via table action

I have a table with an edit action, triggering a modal that contains the edit form for the model. I have to process some of the data before submitting the Eloquent update request. My plan was to check that the request was successful, then trigger a notification as the modal is closed. My code looks like this applicable part of my code looks like this:
* DATA PROCESSING OCCURS HERE *

$updateAvailability = $availability->update($data);

if ($updateAvailability) {
$message = $this->availHeading . ' updated';

Notification::make()
->title($message)
->success()
->send();
}
* DATA PROCESSING OCCURS HERE *

$updateAvailability = $availability->update($data);

if ($updateAvailability) {
$message = $this->availHeading . ' updated';

Notification::make()
->title($message)
->success()
->send();
}
I'm successfully triggering my data processing, but the modal closes immediately after the $updateAvailability = $availability->update($data); call, and doesn't trigger a standard "save" notification. I've got this all handled within the action() method of the EditAction instance. Is there a way to force in a notification on successful edit/update of the data model?
2 Replies
LeandroFerreira
LeandroFerreira17mo ago
->after(function($record) {
//notification
})
->after(function($record) {
//notification
})
?
Saade
Saade17mo ago
@ryandrewniak if Leandro's answer works for you, please mark this thread as Solved ✅
Want results from more Discord servers?
Add your server