In my controller/action:
if(!empty($_POST))
{
if(Auth::attempt(Input::get(\'data\')))
{
return Redirect::intended();
}
else
{
Of course there is a method to find out the type of the request, But instead you should define a route that handles POST
requests, thus you don't need a conditional statement.
routes.php
Route::post('url', YourController@yourPostMethod);
inside you controller/action
if(Auth::attempt(Input::get('data')))
{
return Redirect::intended();
}
//You don't need else since you return.
Session::flash('error_message','');
The same goes for GET
request.
Route::get('url', YourController@yourGetMethod);