[Symfony\Component\Debug\Exception\FatalThrowableError] Class 'User' not found

  • | 980 points

    After I reinstalled laragon, then

    λ php artisan db:seed
    Class 'User' not found

    The code in DatabaseSeeder
    $user = new User();

    But it works as
    $user = new \App\User();

    I could not find the solution. php artisan could not work at
    λ php artisan db:seed
    λ php artisan make:migration (works at 5.5: php artisan migrate)

  • administrators
    | 132054 points

    @martin : Can you try:

    composer install

  • | 980 points

    Thanks for help that much save my times. It works fine.
    λ composer install
    Loading composer repositories with package information
    Installing dependencies (including require-dev) from lock file
    Nothing to install or update
    Generating optimized autoload files

    @php artisan package:discover
    Discovered Package: fideloper/proxy
    Discovered Package: laravel/tinker
    Discovered Package: laravel/socialite
    Discovered Package: yajra/laravel-datatables-oracle
    Discovered Package: laravelcollective/html
    Discovered Package: sgsoft-studio/base
    Discovered Package: barryvdh/laravel-debugbar
    Package manifest generated successfully.
    php artisan optimize

  • | 980 points

    Sorry it woks as
    $user = new \App\User();

    Still not work as
    $user = new User();

    reinstalled details

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.