Are you trying to pass $user
variable to your controller ?
Can you post your complete code block.
//display login form Route::get('login', function(){ return View::make('login'); }); //login users Route::post('login', function(){ $user = array( 'username' => Input::get('email'), 'password' => Input::get('password') );
if (Auth::attempt($user)) {
return Redirect::to('profile');
} else {
return Redirect::to('login')
->with('login_errors', 'Your Email or Password is incorrect.');
}
});
The attempt method takes an array. How could it authenticate without passing in the password?
if (Auth::attempt(array('email' => $email, 'password' => $password)))
{
return Redirect::intended('dashboard');
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community