My auth:: an attempt is not working. but my registration Form data will be stored in the User database and I also applied auth:: check(), it is also not working.
This is the controller
public function showLoginform(Request $request){
$this->validate($request,[
'email' => 'required',
'password' => 'required',
]);
$user_data = array(
'email' => $request->get('email'),
'password' => $request->get('password')
);
if(Auth::attempt($user_data)){
//return \redirect::to("logged in successfuly");
echo "yes match";
} else{
echo "not match";
// return "oopps something wrong";
}
}
here is my model
class User extends Authenticatable { use Notifiable;
protected $table="users";
protected $fillable = [ 'name', 'email', 'password', 'phonenumber' , 'profession' , 'images' ];
protected $hidden = [
'password', 'remember_token',
];
}