After using the IlluminateAuthAuthenticatable
trait on a model, I can now do Auth::id()
in places in my app (when the current auth-ed thing is that particular model).
Is there a way to get the class / type of the auth-ed model?
Perhaps something like Auth::model()
which might return the model’s class name (such as AppModelsUser or AppModelsMyCustomAuthCapabaleModel)?
2
Answers
Auth::user();
returns all the information about the authenticated userAuth::user();
returns the model of the logged in user.If you ever wish to change the
User
model, you can change it inconfig/auth.php
at the keyproviders.users.model