My auth function is always returning false in my UserController function, here is my controller function.
public function postSignin(Request $request)
{
$userdata = array(
'email' => $request->input('email'),
'password' => $request->input('password')
);
if (Auth::attempt($userdata))
{
return redirect()->route('user.profile');
}
else
{
return redirect()->back();
}
}
and here is my route code
Route::post('/signin', [
'uses' => 'UserController@postSignin' , 'as' => 'user.signin'
]);
When I enter the credentials, the if part of auth is not working and I am redirected to my page as instructed by the else condition...
php artisan make:authfor this?Hash::make()when creating user?