Download the PHP package gbuckingham89/laraflash without Composer
On this page you can find all versions of the php package gbuckingham89/laraflash. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gbuckingham89/laraflash
More information about gbuckingham89/laraflash
Files in gbuckingham89/laraflash
Package laraflash
Short Description A package for handling flash messages / notifications in Laravel.
License MIT
Homepage https://github.com/gbuckingham89/laraflash
Informations about the package laraflash
gbuckingham89/laraflash v5.x
A simple package for handling flash messages / notifications in Laravel. Written to suit my needs - but hopefully someone else will find it useful too.
The current version requires Laravel 7.0 & PHP 8.0 or greater. If you have a project that requires a lower version of PHP or Laravel, check the requirements of the older releases.
Installation
The recommended way is using Composer - simply run this command in your terminal:
The service provider and facade will be automatically registered for you unless you have disabled auto discovery. If this is the case, you'll need to manually register the service provider and facade:
For the service provider, add the following to the providers array in your app.php config file:
For the facade, add the following to the aliases array in your app.php config file:
Finally, you'll need to publish the view file (unless you want to roll your own). Do this by running this command in your terminal:
Use
Setting a message
Before you redirect to another page, simply use the Laraflash facade to set your message. You can call the main flash method as follows:
The first parameter is your message, the second is the priority level.
There are also four helper methods available for easier setting of priority levels:
Displaying the message
To display the message, simply include the bundled view (built for Bootstrap) in your view:
Alternatively, you can access the data in the session directly (stored in laraflash.message and laraflash.level) and roll your own view.
Testing Assertions
This package provides Gbuckingham89\Laraflash\LaraflashAssertions with some basic/common assertions if you have to test that your responses contain a laraflash message, or not.
Copyright and license
Code and documentation copyright George Buckingham.
Code released under the MIT License.
All versions of laraflash with dependencies
illuminate/testing Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/session Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0