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

Answers 1
  • Import User model in controller laravel 8

    --PATH app\Http\Controllers\<YourController>.php
    use App\Models\User;
    class YourController extends Controller
    {
    
    }
    
    0

    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