Laravel 5 Class App\\Console\\Kernel not found

2019-07-23 03:25发布

问题:

After running all updates on laravel then running php artisan make:form Forms/PostForm I get an uncaught ReflectionException error that class App\Console\Kernel can't be found.

Fatal error: Uncaught exception 'ReflectionException' with message 'Class App\Co
nsole\Kernel does not exist' in C:\Projects\messaging\vendor\laravel\framework\s
rc\Illuminate\Container\Container.php on line 776

ReflectionException: Class App\Console\Kernel does not exist in C:\Projects\mess
aging\vendor\laravel\framework\src\Illuminate\Container\Container.php on line 77
6

Call Stack:
    0.0004     125160   1. {main}() C:\Projects\messaging\artisan:0
    0.0387    1054896   2. Illuminate\Foundation\Application->make() C:\Projects
\messaging\artisan:31
    0.0387    1054976   3. Illuminate\Container\Container->make() C:\Projects\me
ssaging\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:644
    0.0387    1054976   4. Illuminate\Container\Container->build() C:\Projects\m
essaging\vendor\laravel\framework\src\Illuminate\Container\Container.php:656
    0.0387    1054976   5. Illuminate\Container\Container->Illuminate\Container\
{closure}() C:\Projects\messaging\vendor\laravel\framework\src\Illuminate\Contai
ner\Container.php:773
    0.0387    1055024   6. Illuminate\Foundation\Application->make() C:\Projects
\messaging\vendor\laravel\framework\src\Illuminate\Container\Container.php:229
    0.0387    1055024   7. Illuminate\Container\Container->make() C:\Projects\me
ssaging\vendor\laravel\framework\src\Illuminate\Foundation\Application.php:644
    0.0388    1055040   8. Illuminate\Container\Container->build() C:\Projects\m
essaging\vendor\laravel\framework\src\Illuminate\Container\Container.php:656
    0.0388    1055216   9. ReflectionClass->__construct() C:\Projects\messaging\
vendor\laravel\framework\src\Illuminate\Container\Container.php:776

回答1:

As for the error on existing projects. Make sure the bindings in bootstrap/app.php are correct and run composer dump-autoload to clear out any lingering issues.



标签: php laravel-5