Support the ongoing development of Laravel.io →
Authentication Session Packages
Last updated 2 years ago.
0
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?

Last updated 2 years ago.
0

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?

Last updated 2 years ago.
0

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'
Last updated 2 years ago.
0

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?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.