You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extract auth concerns from Model into an Authable base class #332
Auth-specific behavior currently sits on the generic Model class (e.g. getAuthKeyName()). Model should stay generic. Only models that authenticate need auth methods and attributes.
The Auth facade also documents User, which is not a framework type. Auth already resolves the model configured per actor in config/auth.php, so locking the type to User is wrong.
Proposal
Add an Authable base class that extends Model and owns everything auth needs.
Remove auth methods from Model (starting with getAuthKeyName()).
Put auth-related helpers on Authable instead of reading raw attributes through Auth, including things like:
auth key name (getAuthKeyName())
auth identifier / primary key
password hash access
remember token get/set
two-factor secret / recovery codes access
persist (save()) where Auth needs it
Type Auth (Auth facade + Authenticate) against Authable, not User or an untyped $user.
Application auth models (User, later Admin, etc.) extend Authable instead of Model directly.
Multi-actor auth via config/auth.php stays the same. Each actor still points at its own model. Those models just extend Authable.
Example
// beforeclass User extends Model { ... }
// afterclass User extends Authable { ... }
@xentixar I’ll check it, but did you also review runtime/config/auth.php? We can support multi-actor authentication by configuring the actors in this file.
I agree this is still an issue with the facade annotation:
@xentixar I’ll check it, but did you also review runtime/config/auth.php? We can support multi-actor authentication by configuring the actors in this file.
I agree this is still an issue with the facade annotation:
@techmahedy Multi-actor via config/auth.php is fine, this isn't about changing that. Just the facade/login typing: there's no User in the framework, so an Authenticatable contract fits better for whatever model the actor uses.
changed the title [-]Type Auth facade users as an Authenticatable contract[/-][+]Extract auth concerns from Model into an Authable base class[/+]on Sep 24, 2026
Activity
techmahedy commentedon Sep 24, 2026
@xentixar I’ll check it, but did you also review
runtime/config/auth.php? We can support multi-actor authentication by configuring the actors in this file.I agree this is still an issue with the facade annotation:
xentixar commentedon Sep 24, 2026
@techmahedy Multi-actor via config/auth.php is fine, this isn't about changing that. Just the facade/login typing: there's no User in the framework, so an Authenticatable contract fits better for whatever model the actor uses.
techmahedy commentedon Sep 24, 2026
Ok i am going to use newly created Authable contract
[-]Type Auth facade users as an Authenticatable contract[/-][+]Extract auth concerns from Model into an Authable base class[/+]