dev-master
9999999-devA laravel 4 error manager package
The Requires
- php >=5.3.0
- illuminate/support 4.2.*
by Michael Jennings
A laravel 4 error manager package
A wrapper for the laravel 4 message bag to make it simpler to add and retrieve messages, also flashes messages to the session so they can be retrieved on the next request., (*1)
Include the package in your composer.json
., (*2)
"michaeljennings/errormanager": "dev-master";, (*3)
Run composer install
or composer update
to download the dependencies., (*4)
Once the package has been downloaded add the validation service provider to the list of service providers in
app/config/app.php
., (*5)
'providers' => array(, (*6)
'Michaeljennings\ErrorManager\ErrorManagerServiceProvider'
);, (*7)
Add the Error
facade to your aliases array., (*8)
'aliases' => array( 'Error' => 'Michaeljennings\ErrorManager\Facades\Error', );
To add a message into the message bag use the add
method., (*9)
Error::add('foo', 'bar');
To check if there are any errors in the current message bag use the hasErrors
method., (*10)
Error::hasErrors();
To retrieve the errors from the message bag use the errors
method., (*11)
Errors::errors();
You may also use any of the standard message bag functions., (*12)
$errors = Errors::errors(); $errors->has('foo) $errors->first('bar')
You may also redirect with the errors., (*13)
return Redirect::back()->withErrors(Errors::errors());
A laravel 4 error manager package