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

Updated at 05-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