2017 © Pedro Peláez
 

library one-message

Laravel Package for managing messages

image

howlowck/one-message

Laravel Package for managing messages

  • Wednesday, January 22, 2014
  • by howlowck
  • Repository
  • 1 Watchers
  • 1 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 3 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

OneMessage Build Status

For Easy Management of Messages in One singleton. Anywhere in the process you want to add a message just add it in the singleton and in the view just use it to display your messages., (*1)

Feature:

  1. Handles Flash or Same-Request Messages
  2. Handles Validation Messages
  3. Easy API

Setup:

in app/config/app.php, (*2)

  • Add Service provider add 'Howlowck\OneMessage\OneMessageServiceProvider' in providers array, (*3)

  • Add Facade add 'OneMessage' => 'Howlowck\OneMessage\Facades\OneMessage' in aliases array, (*4)

Usage:

There are three type of messages: Error, Success, and Info., (*5)

Add Message, (*6)

OneMessage::addError(['authorization' => 'You are unauthorized!!!']);

or you can throw a MessageBag in there, (*7)

$v = Validator::make($data, $rules);
if ($v->fails()) {
    OneMessage::addError($v->errors());
}

Add Message for Flash
When adding to the flash data, it will not be available in the current request., (*8)

OneMessage::addError(['authorization' => 'You are unauthorized!!!'], true);

get Message, (*9)

OneMessage::getError();

or get a specific message with key, (*10)

OneMessage::getError('authorization');

The Versions

22/01 2014

dev-master

9999999-dev

Laravel Package for managing messages

  Sources   Download

The Requires

 

The Development Requires

22/01 2014

0.1.0

0.1.0.0

Laravel Package for managing messages

  Sources   Download

The Requires

 

The Development Requires