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


  • | 980 points

    After I reinstalled laragon, then

    λ php artisan db:seed
    [Symfony\Component\Debug\Exception\FatalThrowableError]
    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
    | 66720 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

    Illuminate\Foundation\ComposerScripts::postAutoloadDump
    @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.
    Illuminate\Foundation\ComposerScripts::postInstall
    php artisan optimize


  • | 980 points

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

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

    reinstalled details
    https://forum.laragon.org/topic/683/could-not-open-input-file-composer-phar


Log in to reply
 

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