sammaye / laravel-flash
My very Laravel first plugin, based on https://github.com/laracasts/flash
Requires
- php: >=5.4.0
- illuminate/support: >=5.0
This package is auto-updated.
Last update: 2024-11-18 07:30:28 UTC
README
My very first plugin, based on https://github.com/laracasts/flash
This is strictly designed as a session based alert for errors and the such.
This is not supposed to be used as a general alert.
How to make an alert
To make an alert:
Flash::error('You got hell to pay')
which supports these types of alerts:
- error
- success
- warning
- info
How to make it dismissible
Simply add a second paramter of true
or false
depending on whether you want it dismissible or not.
Flash::error('You got hell to pay', true)
This alert can be dismissed because it has the second parameter of true
.
How to display alerts in my template
Simple:
@include('flash::flash')
This plugin registers all of its views at the flash namespace and only has one view, flash
.
This plugin also registers the view for publishing as such you can do this to enable the view to be overridden:
php artisan vendor:publish --provider="sammaye\Flash\Providers\FlashServiceProvider"