Hi all, I'm struggling in implementing disable user functionality. The only thing i'm missing is how to not to login the user if it's disabled (it's a property of the user model).
Apparently the service provider injects an instance of Illuminate\Auth\Guard, so i don't know how to overwrite the attempt method and i don't know if it's the right way.
Please "illuminate" me :)
Auth::attempt accept an associative array with all element you want to check against model defined in auth config file.
You shouldn't override anything.
Auth::attempt(['username'=>'...', 'password'=>'...', 'disabled'=>false])
The only 'special' value in array passed to Auth::attempt is password because it will be automatically hashed, so you must pass it not hashed.
I don't know if disabled is a real field in database or an appended one. And I don't know if Auth::attempt works for appended attributes.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community