How to use form validation in laravel


Posted on 22 May 15 by Vickey

We have inbuilt validation in laravel by using the laravel validation we can validate our form very easily In this tutorial i have a form which have name and email and password fields for validate this form i use the below code

$userdata = array(

  'name' => Input::get('name'),
  'email' => Input::get('email'),
 'password' => Input::get('password'),


$rules = array(

$validator = Validator::make($userdata, $rules);

    return Redirect::back()->withInput()->withErrors($validator);
              // save record in databse


for show validation message on view use


        {{ implode ('', $errors->all('<p><strong>:message</strong></p>'))}}


If this post help you reduce time to develop, you can help me to maintain this website :)