You can add buttons to notifications using NotifyAction::make().
Supported Models: Toast, Connect, Smiley, and Emotify (Note: Drake does not support actions).
Action Types:
- URL Actions: Use
url($path) to create a GET link. Use openUrlInNewTab() to target _blank. - Execution Actions: Use
action($route) to trigger a controller method. This defaults to a POST request. Use method($method) to specify PUT or DELETE.
Constraints:
- You cannot use both
action() and url() on the same action. method() can only be used with action().openUrlInNewTab() can only be used with url().
use Mckenziearts//
// URL Action
NotifyAction::make()
->label('View details')
->url(route('users.show', $user->id))
->openUrlInNewTab();
// Execution Action (POST)
NotifyAction::make()
->label('Restore')
->action(route('users.restore', $user->id));
// Execution Action (DELETE)
NotifyAction::make()
->label('Delete')
->action(route('users.delete', $user->id))
->method('DELETE')
->classes('text-red-600');