Coder Social home page Coder Social logo

errormanager's Introduction

Error Manager

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.

Installation

Include the package in your composer.json.

"michaeljennings/errormanager": "dev-master";

Run composer install or composer update to download the dependencies.

Once the package has been downloaded add the validation service provider to the list of service providers in app/config/app.php.

'providers' => array(

'Michaeljennings\ErrorManager\ErrorManagerServiceProvider'

);

Add the Error facade to your aliases array.

'aliases' => array(
  
  'Error' => 'Michaeljennings\ErrorManager\Facades\Error',

);

Usage

To add a message into the message bag use the add method.

Error::add('foo', 'bar');

To check if there are any errors in the current message bag use the hasErrors method.

Error::hasErrors();

To retrieve the errors from the message bag use the errors method.

Errors::errors();

You may also use any of the standard message bag functions.

$errors = Errors::errors();

$errors->has('foo)
$errors->first('bar')

You may also redirect with the errors.

return Redirect::back()->withErrors(Errors::errors());

errormanager's People

Contributors

michaeljennings avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.