In my controller/action:
if(!empty($_POST))
{
if(Auth::attempt(Input::get('data')))
{
return Redirect::intended();
}
else
{
Session::flash('error_message','');
}
}
Is there a method in Laravel
to check if the request is POST
or GET
?
According to Laravels docs, there's a Request method to check it, so you could just do:
$method = Request::method();
or
if (Request::isMethod('post'))
{
//
}