oanhnn/laravel-flash-message
Composer 安装命令:
composer require oanhnn/laravel-flash-message
包简介
Laravel Flash Message for Laravel 5.4+
README 文档
README
Easy Flash Messages for Your Laravel 5.4+ Application
Main features
This composer package offers a Twitter Bootstrap optimized flash messaging setup for your Laravel 5.4+ Applications.
Requirements
- php >=7.0
- Laravel 5.4+
Installation
Begin by pulling in the package through Composer.
$ composer require oanhnn/laravel-flash-message
Next, if using Laravel 5.5+, you done. If using Laravel 5.4, include the service provider within your config/app.php file.
// config/app.php 'providers' => [ // Other service providers... Laravel\FlashMessage\FlashMessageServiceProvider::class, ], 'aliases' => [ // Other alias classes 'Flash' => Laravel\FlashMessage\Facades\Flash::class, ],
Finally, as noted above, the default CSS classes for your flash message are optimized for Twitter Bootstrap. As such, pull in the Bootstrap's CSS within your HTML or layout file.
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
Usage
Within your controllers, before you perform a redirect, use Flash facade.
public function save() { Flash::success('Save success!')->important(); return redirect('/home'); }
You may also do:
| method | description |
|---|---|
Flash::success('message') |
Set the flash message with theme "success alert". |
Flash::warning('message') |
Set the flash message with theme "warning alert". |
Flash::error('message') |
Set the flash message with theme "error alert". |
Flash::info('message') |
Set the flash message with theme "info alert". |
Flash::info('message')->important() |
Add a close button to the flash message. |
Flash::info('message')->overlay('title') |
Display flash message as a modal overlay with a title. |
And include flash message view into your blade template.
@include('flash::message')
Changelog
See all change logs in CHANGELOG
Testing
$ git clone git@github.com/oanhnn/laravel-flash-message.git /path
$ cd /path
$ composer install
$ composer phpunit
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email to Oanh Nguyen instead of using the issue tracker.
Credits
License
This project is released under the MIT License.
Copyright © 2017-2018 Oanh Nguyen.
oanhnn/laravel-flash-message 适用场景与选型建议
oanhnn/laravel-flash-message 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.65k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 05 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 oanhnn/laravel-flash-message 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 oanhnn/laravel-flash-message 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 6.65k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-26