masterro/laravel-flashes
最新稳定版本:v1.6.0
Composer 安装命令:
composer require masterro/laravel-flashes
包简介
Easy flash messages
README 文档
README
Easy Flash Messages for Laravel
Fast flash message integration.
Installation
From the command line, run:
composer require masterro/laravel-flashes
Usage
Somewhere set the flash message
flash("Hello, {$name}!");flash("Hello, {$name}!", 'success');flash()->error($message);// ->success(), ->info(), ->warning(), ->error()flash()->with(['body' => 'My custom body text']);// ->success(), ->info(), ->warning(), ->error()Flash::info('Flash!');
Before closing </body> tag
@include('flash-messages::script')
or implement your own render logic
php artisan vendor:publish --tag=flash-messages-views
Implement notify method (bootstrap-notify example)
Package will trigger window.notify(message, type) global javascript function that you should implement. As an example here is bootstrap-notify implementation:
window.notify = (message, type = 'success', options = {}) => { if (type === 'error') { type = 'danger'; } return window.$.notify(window._.merge({ message: message }, options), { type: type, animate: { enter: 'animated bounceIn', exit: 'animated bounceOut' }, z_index: 9999, delay: 7000, mouse_over: 'pause', offset: { x: 20, y: 30 } }); };
It requires bootstrap, bootstrap-notify and animate.css
You can install and require those with yarn or npm:
yarn add bootstrap-notify or npm i bootstrap-notify --save
统计信息
- 总下载量: 25.4k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-14