Download the PHP package royvoetman/laravel-flash-alerts without Composer
On this page you can find all versions of the php package royvoetman/laravel-flash-alerts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download royvoetman/laravel-flash-alerts
More information about royvoetman/laravel-flash-alerts
Files in royvoetman/laravel-flash-alerts
Package laravel-flash-alerts
Short Description Automatically flash success alerts in resources controllers: `store`, `update` and `destroy` methods.
License MIT
Informations about the package laravel-flash-alerts
Laravel Flash Alerts
This packages will automatically flash success messages to the session when a controller's: store
, update
or destroy
method was successfully executed.
An execution is considered successful when no exceptions were raised and no messages are defined in the current session under the key warning
.
Installation
Add FlashAlerts middleware to the routeMiddleware array in app/Http/Kernel.php
Add the FlashesAlerts trait to your applications BaseController
Signature
- $model
- A string used in the flash messages for example
$model = 'Book'
will result in:The Book has been successfully added
- A string used in the flash messages for example
- $except
- An array of methods that are skipped while registering middleware.
Usage
If the middleware is registered and a store
, update
or destory
method has been successfully executed.
A message will be flashed in the current session under the key alert
.
If the current session has a message under the key warning
or an exception is thrown, the request will not be considered successful.
Example
Ignoring methods
Displaying flash alerts
Change Alert messages
This will place the overwritable translations under resources/lang/vendor/laravel-flash-alerts
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Contributions are welcome and will be fully credited. We accept contributions via Pull Requests on Github.
Pull Requests
- PSR-2 Coding Standard - The easiest way to apply the conventions is to install PHP Code Sniffer.
- Document any change in behaviour - Make sure the
README.md
and any other relevant documentation are kept up-to-date. - Create feature branches - Don't ask us to pull from your master branch.
- One pull request per feature - If you want to do more than one thing, send multiple pull requests.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-flash-alerts with dependencies
illuminate/support Version ^5.1|^5.2|^5.3|^6.0|^7.0|^8.0|^9.0|^10.0