darkclow4
darkclow4
FFilament
Created by Rolland on 9/6/2024 in #❓┊help
how to trigger notification on a custom bulkaction?
you can just move notification to action like this
->action(function (Collection $records) {
$records->each(function (User $user) {
$user->update(['is_active' => !$user->is_active]);
});

Notification::make()
->success()
->title('User status updated')
->body('The selected users\' statuses have been toggled.')
->send();
})
->action(function (Collection $records) {
$records->each(function (User $user) {
$user->update(['is_active' => !$user->is_active]);
});

Notification::make()
->success()
->title('User status updated')
->body('The selected users\' statuses have been toggled.')
->send();
})
5 replies