简体   繁体   English

如何设置 Laravel Nova Action Response Messages 的持续时间

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

According to the documentation we have the possibility to return toast messages when actions are being run.根据文档,我们有可能在运行操作时返回 toast 消息。 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?我目前正在执行一项需要 5-8 分钟才能执行的操作,因此如果用户单击离开,则无法在屏幕上保留该吐司消息,以便在您打开选项卡以恢复工作时它就在那里? Maybe with an "Ok?"也许用“好的?” button on the toast?吐司上的按钮?

send notification using the laravel nova 4 notification feature.使用 laravel nova 4 通知功能发送通知。

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')
);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM