1
votes

I run php artisan config:clear or php artisan cache:clear or composer dump-autoload But show this error:

PHP Fatal error:  Uncaught ReflectionException: Class App\Console\Kernel does not exist in 
vendor/laravel/framework/src/Illuminate/Container/Container.php:767
Stack trace:
#0    
vendor/laravel/framework/src/Illuminate/Container/Container.php(767): ReflectionClass->__construct('App\\Console\\Ker...')
#1    
vendor/laravel/framework/src/Illuminate/Container/Container.php(646): 
Illuminate\Container\Container->build('App\\Console\\Ker...')
#2 
vendor/laravel/framework/src/Illuminate/Container/Container.php(601): 
Illuminate\Container\Container->resolve('App\\Console\\Ker...', Array)
#3      
   vendor/laravel/framework/src/Illuminate/Foundation/Application.php(734):     
Illuminate\Container\Container->make('App\\Console\\Ker...', Array)
#4     
vendor/laravel/framework/src/Illuminate/Container/Container.php(256):     
Illuminate\Foundation\Appl in 
vendor/laravel/framework/src/Illuminate/Container/Container.php on 
line 767

Laravel version is 5.6

I run php artisan config:clear or php artisan cache:clear or composer dump-autoload.

Show this error after run php artisan config:clear

Update 1:

My Composer.json file is this code:

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=7.1.3",
    "bogardo/mailgun": "^5.0",
    "cviebrock/eloquent-sluggable": "^4.5",
    "fideloper/proxy": "~4.0",
    "intervention/image": "^2.4",
    "laravel/framework": "5.6.*",
    "laravel/tinker": "~1.0",
    "laravelcollective/html": "^5.6",
    "php-http/guzzle6-adapter": "^1.1",
    "pusher/pusher-php-server": "^3.0",
    "uxweb/sweet-alert": "^1.4"
},
"require-dev": {
    "filp/whoops": "~2.0",
    "nunomaduro/collision": "~1.1",
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "~1.0",
    "phpunit/phpunit": "~7.0",
    "symfony/thanks": "^1.0"
},
"aXutoload": {
    "classmap": [
        "database/seeds",
        "database/factories"
    ],
    "psr-4": {
        "App\\": "app/"
    }
},
"autoload-dev": {
    "psr-4": {
        "Tests\\": "tests/"
    }
},
"extra": {
    "laravel": {
        "dont-discover": [
        ]
    }
},
"scripts": {
    "post-root-package-install": [
        "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "@php artisan key:generate"
    ],
    "post-autoload-dump": [
        "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
        "@php artisan package:discover"
    ]
},
"config": {
    "preferred-install": "dist",
    "sort-packages": true,
    "optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}

This file is My composer.json. How to issue this problem?

3
can you share composer.json fileArun jai
@Arunjai Hi, I update my questioncrbin1
composer.json file is fine no problem.Arun jai
Did you try composer update?Arun jai
@Arunjai I can't run composer update but show this error.crbin1

3 Answers

2
votes

I got this same issue, to solve it delete the file config.php in bootstrap/cache, but if you run command php artisan config:cache,the same error will reappear

1
votes

From Laravel doc

Laravel ^5.5

@php Blade Directive

The @php blade directive no longer accepts inline tags. Instead, use the full form of the directive:

@php
    $teamMember = true;
@endphp
0
votes

rename bootstrap/cache/config_old.php and also rename routes-v-old.php

i hope you got your solution .