My User mode is namespaced as Vendorname/Package as is all my other files in the User package.
So why are you loading it from the main package? (/) You should instead load /Vendorname/Packagename/User because this is where jour User class id namespaced.
Is it a little more understandable now?
atrakeur said:
My User mode is namespaced as Vendorname/Package as is all my other files in the User package.
So why are you loading it from the main package? (/) You should instead load /Vendorname/Packagename/User because this is where jour User class id namespaced.
Is it a little more understandable now?
I understand what you are saying but where do I change this?
It is not actually me that is adding the '/' it seems Laravel is getting the user model from app/config/auth.php and adding the '/'
Perhaps I am missing something, but it looks as though Laravel (Auth) is actually trying to find the User class in app/models?
Well, you are almost at the solution. In app/config/app.php there is a model item that specify the model used as the User, just specify the model including the full namespaced name.
So
'model' => 'User',
becomes
'model' => 'Vendorname\Packagename\User'
atrakeur said:
Well, you are almost at the solution. In app/config/app.php there is a model item that specify the model used as the User, just specify the model including the full namespaced name.
So
'model' => 'User',
becomes
'model' => 'Vendorname\Packagename\User'
In config/app.php not config/auth.php? (There isn't an option in app.php)
Even when I change it (in config/auth.php) laravel is prepending the '/' at the start, is that normal? Does that make a difference?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community