Why laravel 6 auth returns false after redirecting by using custom guard?

前端 未结 4 993
醉梦人生
醉梦人生 2021-01-18 23:31

I am trying to make auth through laravel package using admins table. In the project directory I added admin guard into config/auth.php

\'providers\' => [
         


        
4条回答
  •  太阳男子
    2021-01-18 23:50

    Auth::guard('admin')->attempt($request->only('email','password') its returning true or false? If returning false then maybe toy didnt hashed your password Try add this in your Model

     public function setPasswordAttribute($password)
        {
            $this->attributes['password'] = Hash::make($password);
        }
    

提交回复
热议问题