oanhnn / laravel-flash-message
Laravel Flash Message for Laravel 5.4+
Installs: 6 653
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
- illuminate/contracts: 5.4.*|5.5.*
- illuminate/session: 5.4.*|5.5.*
- illuminate/support: 5.4.*|5.5.*
Requires (Dev)
- mockery/mockery: ~0.9
- phpunit/phpunit: ~6.1
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-11-08 08:30:21 UTC
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:
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.