radiate-framework / framework

A WordPress plugin and theme framework
https://radiate-framework.github.io/
MIT License
4 stars 0 forks source link

AuthManager return a User model #51

Closed BenRutlandWeb closed 3 years ago

BenRutlandWeb commented 3 years ago

Is your feature request related to a problem? Please describe. The AuthManager::user method only returns a WP_User. I want to return a custom class instead.

Describe the solution you'd like Config to set the type of model returned by the AuthManager like how Laravel works.

Additional context Laravel let's you choose what model to return from the auth facade so the framework should have the option as the WP_User model isn't great.

BenRutlandWeb commented 3 years ago

How would the new model be hydrated? Some ongoing work regarding Models #48 #50 will make it possible to return a User model however I don't know how a custom model could be used. Perhaps the user method should return an interface so any custom implementations should implement that.

I need to look at what and how Laravel implements this.