"Class \"App\\Models\\Role\" not found" #2390
-
I want to assign role to user but getting this error "message": "Class "App\Models\Role" not found", |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
https://spatie.be/docs/laravel-permission/v5/basic-usage/new-app |
Beta Was this translation helpful? Give feedback.
-
In object-oriented programming such as Laravel, anytime you are referring to a model you need to either have/create that model in the current namespace, or specify the namespace of the model which you are calling. In your situation you probably meant to use |
Beta Was this translation helpful? Give feedback.
In object-oriented programming such as Laravel, anytime you are referring to a model you need to either have/create that model in the current namespace, or specify the namespace of the model which you are calling. In your situation you probably meant to use
\Spatie\Permission\Models\Role