12/08
2015
Wallogit.com
2017 © Pedro Peláez
Base on t4t5/sweetalert, (*1)
composer require nidesky/sweet-alert
// 打开 config/app.php // 在providers中添加 Nidesky\SweetAlert\SweetAlertServiceProvider::class, // 在alias中添加 'Alert' => Nidesky\SweetAlert\Facades\SweetAlert::class,
再执行, (*2)
php artisan vendor:publish
// 在控制器中调用
\Alert::success($title, $msg)
// 在模板中调用
{!! Alert::css() !!}
{!! Alert::js() !!}
@include('sweetalert:sweetalert')
// 如果只是在前端
swal("Good job!", "You clicked the button!", "success")