
Class 'App\Http\Controllers\User' not found
Error Class 'App\Http\Controllers\User' not found occurs when you forget to include the user model in your controller
-
Import User model in controller laravel 8
--PATH app\Http\Controllers\<YourController>.phpuse App\Models\User; class YourController extends Controller { }
You have to import every modal class in your controller which you want to use in laravel to execute insert, delete, update on the particular model
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
Don't forget to share this article! Help us spread the word by clicking the share button below.
We appreciate your support and are committed to providing you valuable and informative content.
We are thankful for your never ending support.
Random Code Snippet Queries: Laravel
- How to delete record in Laravel with ajax
- Always load the relationship data with eager loading in Laravel
- Call to a member function pluck() on array
- Pass variable from blade to controller Laravel
- Redirect to previous page or url in laravel
- Return view from route Laravel
- How to check email is valid or not in Laravel
- Get posts belongs to a specific user in Laravel
- How to get images from AWS s3 and display in Laravel blade
- Store logged in user details in session and display in view in laravel
- Laravel onclick function not working
- Call to a member function update() on null
- Delete file from amazon s3 bucket using Laravel
- Update existing pivot table data in laravel
- How to create projects method with belongstomany relationship in user model
- Update last created record in Laravel
- How to Get records between two dates in Laravel
- How to get only time from created_at in laravel
- How to upload files to amazon s3 bucket using Laravel
- Split an Eloquent Collection by half in Laravel
- How to get specific columns using Laravel eloquent methods
- The use statement with non-compound name 'DB' has no effect
- How to pass variable from controller to model in Laravel
- Extra Filter Query on Relationships in Laravel
- Call to undefined relationship [user] on model [App\Models\Post]