Download the PHP package diegoalvarezb/laravel-front-messages without Composer
On this page you can find all versions of the php package diegoalvarezb/laravel-front-messages. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download diegoalvarezb/laravel-front-messages
More information about diegoalvarezb/laravel-front-messages
Files in diegoalvarezb/laravel-front-messages
Package laravel-front-messages
Short Description Management of flash messages and custom messages in the same way.
License MIT
Homepage https://github.com/diegoalvarezb/laravel-front-messages
Informations about the package laravel-front-messages
laravel-front-messages
This tool handle front messages in Laravel.
As Laravel allows by default to add flash (session) messages that will be shown in the next page, this package allows to join those messages with the ones you want to add in the current view.
So using this package you could manage messages regardless of whether you are rendering a view or redirecting to another route.
Requirements
- PHP >= 5.6
- Laravel >= 5.0
Installation and configuration
Package installation with composer:
And add the service provider in your config/app.php
file:
Add message
To add a message in a controller you have to add the Diegoalvarezb\FrontMessages\FrontMessagesTrait
. With this trait you could use the addHtmlMessage
method:
You can add as many messages as you like in every moment.
Customize messages view
You have to execute this command:
This command will copy the default view into the resources/views/vendor folder. After that, you could edit this file, and use it in any blade template:
Examples
There are four types of messages:
- danger
- info
- success
- warning
License
MIT