2017 © Pedro Peláez
 

library laravel-message-binder

A little hack for Illuminate View to access flash messages easily.

image

kohkimakimoto/laravel-message-binder

A little hack for Illuminate View to access flash messages easily.

  • Sunday, August 17, 2014
  • by kohkimakimoto
  • Repository
  • 1 Watchers
  • 2 Stars
  • 28 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Laravel Message Binder

A little hack for Illuminate View to access flash messages easily., (*1)

You can use the withMessages method like a laravel builtin method withErrors in a general purpose., (*2)

Route::get('register', function()
{
    return View::make('user.register');
});

Route::post('register', function()
{
    $rules = array(...);

    $validator = Validator::make(Input::all(), $rules);

    if ($validator->fails())
    {
        return Redirect::to('register')->withErrors($validator);
    }

    // You can use the `withMessages` method like a laravel builtin method `withErrors` in a general purpose.
    return Redirect::to('register')->withMessages(array('default' => 'Success!');
});

After redirection, you may utilize the automatically bound $messages variable in your view:, (*3)

<?php echo $messages->first('default'); ?>

see also laravel docs#validation, (*4)

Installation

Add dependency in composer.json, (*5)

"require": {
    "kohkimakimoto/laravel-message-binder": "0.*"
}

Run composer update command., (*6)

$ composer update

Add MessageBinderServiceProvider to providers array in app/config/app.php, (*7)

'providers' => array(
    ...
    'Kohkimakimoto\MessageBinder\MessageBinderServiceProvider',
),

LICENSE

The MIT License, (*8)

Author

Kohki Makimoto kohki.makimoto@gmail.com, (*9)

The Versions

17/08 2014

dev-master

9999999-dev

A little hack for Illuminate View to access flash messages easily.

  Sources   Download

MIT

The Requires

 

The Development Requires

17/08 2014

v0.1.1

0.1.1.0

A little hack for Illuminate View to access flash messages easily.

  Sources   Download

MIT

The Requires

 

The Development Requires

13/08 2014

v0.1.0

0.1.0.0

A little hack for Illminate View to access flash messages easily.

  Sources   Download

MIT

The Requires

 

The Development Requires