1訪問 https://packagist.org/packages/laracasts/flash 查看laracasts/flash的安裝詳情
2使用 composer 來安裝 ,輸入:composer require laracasts/flash
3在config/app.php中的providers 添加 Laracasts\Flash\FlashServiceProvider::class,
4在視圖模板中添加@include('flash::message') 引入,並且在后面跟上調用模態框的js代碼
<script>
$(document).ready(function(){
$('#flash-overlay-modal').modal();
});
</script>
5之后在控制台輸入 php artisan vendor:publish --provider="Laracasts\Flash\FlashServiceProvider"
6這時候在views文件夾中會出現另外一個文件夾,就是flash生成的視圖文件
7,使用就直接調用
flash('密碼修改成功')->overlay(); //使用模態框(彈出框)提示
flash('密碼修改成功')->error(); //使用提示層
8,效果如圖: