How can you set the duration of Laravel Nova Action Response Messages

Viewed 269

According to the documentation we have the possibility to return toast messages when actions are being run. The success message of these can be shown using this kind of code:

return Action::message('It worked!');
return Action::danger('Something went wrong!');

The problem is that these messages are on screen for only a few seconds.

I am currently working on an action which takes 5-8 minutes to execute so if the user clicks away there's no way to keep that toast message on screen so that it's there when you open tab to resume work? Maybe with an "Ok!" button on the toast?

1 Answers

send notification using the laravel nova 4 notification feature.

use Laravel\Nova\Notifications\NovaNotification;

$request->user()->notify(
    NovaNotification::make()
        ->message('Your report is ready to download.')
        ->action('Download', 'https://example.com/report.pdf')
        ->icon('download')
        ->type('info')
);
Related