littlestarsx / toastr-5-laravel
laravel5 版本的 toastr
dev-master
2020-08-28 07:43 UTC
Requires
- php: >=5.5.9
This package is auto-updated.
Last update: 2024-09-28 16:31:13 UTC
README
toastr.js for laravel5
安装
- 运行 composer require littlestarsx/toastr
- 将 Littlestarsx\Toastr\ToastrServiceProvider::class 添加到 config/app.php 中的 providers
- 将 'Toastr' => Littlestarsx\Toastr\Facades\Toastr::class 添加到 config/app.php 中的 aliases
- 运行 php artisan vendor:publish
使用方法
只需将此代码添加到您的 blade 模板文件中
{!! Toastr::render() !!}
在控制器中使用这些方法
- Toastr::warning($message, $title = null, $options = [])
- Toastr::error($message, $title = null, $options = [])
- Toastr::info($message, $title = null, $options = [])
- Toastr::success($message, $title = null, $options = [])
- Toastr::clear()