Problem with packages after Laravel namespace change to AppModels

So I used the namespace models shift to make the change from App to AppModels.

One of the packages in use (Ticketit) is calls AppUser in it and I need a way to override this.

The offending file is:

How can I override the “use Appuser;” line there?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

From what I am looking at in the source code, that is hardcoded, so you cannot do anything then… I am not sure if you could “fake” the AppUser to point to AppModelsUser using composer but that would be nasty, same if you created a class on inside app folder with name User and it only extends the model like this:

namespace App;

use AppModelsUser as UserModel;

class User extends UserModel { }

That is nasty but maybe is a solution for you…

Edit: If you read carefully the documentation (please do so next time you use a package), it already says to make sure that AppUser exists…

It tells you to do:

namespace App;

class User extends ModelsUser {
    //leave this empty

For more info, see this github issue or create yourself a new one.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x