Class 'App\Http\Controllers\User' not found

Created at 06-Aug-2021 , By samar

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>.php
    use 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

Back to code snippet queries related laravel

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

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.