Laravel-admin 页面消息的使用

Laravel-admin 页面消息的使用

在Laravel-Admin下,返回提示有两种办法,一个是Alerts,另一个是toastr

Alerts


use Illuminate\Support\MessageBag;

$success = new MessageBag([
                'title'   => '恭喜',
                'message' => $_FILES['upfile']['name'].'导入成功',
            ]);

return back()->with(compact('success'));

toastr


use Illuminate\Support\MessageBag;

$success_toastr = admin_toastr('订单:'.$bid.' 已登记', 'success', ['timeOut' => 15000]);

return back()->with(compact('success_toastr'));
use Illuminate\Support\MessageBag;

$error_toastr = admin_toastr('订单登记失败!请检查您的填写内容', 'error', ['timeOut' => 20000]);

return back()->withInput()->with(compact('error_toastr'));

Leave a Reply