Skip to content
Advertisement

Laravel class ‘UserRole’ not found

Hi i am trying to use a model for a test but i get Class ‘AppUserRole’ not found this is my controller where i am calling it

JavaScript

and this is my model

JavaScript

I dont know what im missing, i tried to do the same with User model and it works perfect, also my table is created and populated.

Advertisement

Answer

Add a namespace to your model

JavaScript

Should look like this:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement