Package Data | |
---|---|
Maintainer Username: | thekanbo |
Maintainer Contact: | shea.lewis89@gmail.com (Shea Lewis) |
Package Create Date: | 2015-01-19 |
Package Last Update: | 2023-03-07 |
Home Page: | https://caffeinatedpackages.com |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-15 15:15:30 |
Package Statistics | |
---|---|
Total Downloads: | 48,103 |
Monthly Downloads: | 116 |
Daily Downloads: | 4 |
Total Stars: | 43 |
Total Watchers: | 5 |
Total Forks: | 14 |
Total Open Issues: | 1 |
Laravel 5 flash messages, originally developed after the Laracasts video tutorial on the same topic: Flexible Flash Messages.
Begin by installing the package through Composer.
composer require caffeinated/flash
Once this operation is complete, simply add both the service provider and facade classes to your project's config/app.php
file:
Caffeinated\Flash\FlashServiceProvider::class,
'Flash' => Caffeinated\Flash\Facades\Flash::class,
And that's it! With your coffee in reach, start flashing out messages!
Usage is simple. Before redirecting to another page, simply call on Flash
to set your desired flash message. There are a number of methods to assign different levels of priority (info, success, warning, and error).
Flash::success('This is a success message.');
Flash::info('This is an info message.');
Flash::warning('This is a warning message.');
Flash::error('This is an error message.');
To render your flash messages in your view, simply include the bundled view partial in your master layout:
@include('flash::message')
Note that the bundled view partial is geared for Bootstrap out of the box.