2017 © Pedro Peláez
 

library laravel-front-messages

Management of flash messages and custom messages in the same way.

image

diegoalvarezb/laravel-front-messages

Management of flash messages and custom messages in the same way.

  • Sunday, September 3, 2017
  • by diegoalvarezb
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

laravel-front-messages

This tool handle front messages in Laravel., (*1)

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., (*2)

So using this package you could manage messages regardless of whether you are rendering a view or redirecting to another route., (*3)

Requirements

  • PHP >= 5.6
  • Laravel >= 5.0

Installation and configuration

Package installation with composer:, (*4)

composer require diegoalvarezb/laravel-front-messages

And add the service provider in your config/app.php file:, (*5)

Diegoalvarezb\FrontMessages\FrontMessagesServiceProvider::class

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:, (*6)

$this->addHtmlMessage($type, $message);

You can add as many messages as you like in every moment., (*7)

Customize messages view

You have to execute this command:, (*8)

php artisan vendor:publish --tag=front-messages

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:, (*9)

@include('vendor.front-messages.messages')

Examples

There are four types of messages: - danger - info - success - warning, (*10)

$this->addHtmlMessage('danger', 'This is an example of danger message');
$this->addHtmlMessage('info', 'This is an example of info message');
$this->addHtmlMessage('success', 'This is an example of success message');
$this->addHtmlMessage('warning', 'This is an example of warning message');

License

MIT, (*11)

The Versions

03/09 2017

dev-master

9999999-dev https://github.com/diegoalvarezb/laravel-front-messages

Management of flash messages and custom messages in the same way.

  Sources   Download

MIT

The Requires

 

by Diego Alvarez

laravel php messages front

31/08 2017

v1.0.1

1.0.1.0 https://github.com/diegoalvarezb/laravel-front-messages

Management of flash messages and custom messages in the same way.

  Sources   Download

MIT

The Requires

 

by Diego Alvarez

laravel php messages front

31/08 2017

v1.0.0

1.0.0.0 https://github.com/diegoalvarezb/laravel-front-messages

Management of flash messages and custom messages in the same way.

  Sources   Download

MIT

The Requires

 

by Diego Alvarez

laravel php messages front