creating form

on views

{{ Form::open(array('method' => 'POST', 'action' => 'LoginController@checkLogin' , 'class' => 'form-login')) }}

<input type="email" name="email" id="exampleInputEmail1" placeholder="Enter email">

...

{{ Form::close() }}

above syntax for genarate form tag

on route

Route::post('/login', 'LoginController@checkLogin');

on controllers

class LoginController extends BaseController {
   public function getIndex()
   {
      return View::make('landing.login');
   }
   public function checkLogin()
   {
      $post = Input::get(); //use Input::get() for retrive $_POST
      return Redirect::to('/'); // use Redirect:to() for redirect
   }
}

Related posts:

This entry was posted in laravel4. Bookmark the permalink.