自己的粗心问题,不用进来了
开发环境:windows+ phpstudy
laravel版本:5.8
只要执行composer update 就找不到HonourRoll类
```
Executing command (CWD): "E:\phpStudy\PHPTutorial\php\php-7.2.1-nts\php.exe" -d
allow_url_fopen="1" -d disable_functions="" -d memory_limit="1536M" artisan pack
age:discover --ansi
ReflectionException : Class App\Console\Commands\HonourRoll does not exist
at E:\project\HGRJ19061708_API\vendor\laravel\framework\src\Illuminate\Container\Container.php:790
786| if ($concrete instanceof Closure) {
787| return $concrete($this, $this->getLastParameterOverride());
788| }
789|
> 790| $reflector = new ReflectionClass($concrete);
791|
792| // If the type is not instantiable, the developer is attemptingto resolve
793| // an abstract type such as an Interface or Abstract Class andthere is
794| // no binding registered for the abstractions so we need to bail out.
Exception trace:
1 ReflectionClass::__construct("App\Console\Commands\HonourRoll")
E:\project\HGRJ19061708_API\vendor\laravel\framework\src\Illuminate\Container\Container.php:790
2 Illuminate\Container\Container::build("App\Console\Commands\HonourRoll")
E:\project\HGRJ19061708_API\vendor\laravel\framework\src\Illuminate\Container\Container.php:667
composer.json文件
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
"iidestiny/laravel-filesystem-oss": "^1.2",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"overtrue/easy-sms": "^1.1",
"tymon/jwt-auth": "1.0.0-rc.4.1",
"workerman/gateway-worker": "^3.0",
"workerman/gatewayclient": "^3.0"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"guanguans/soar-php": "^1.1",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^7.5"
},
看来还是自己粗心导致的
耽误大家时间了,hhh
composer dumpautoload 一下?或者把 vendor 目录删掉
吓得我 赶紧 uodate 了 一下 发现 没有异常 可以执行 开发环境完全一样
看了下报错信息 发现你这个错误 就是 class does not exist 和composer update 没有多大关系
建议查看
App\Console\Commands\HonourRoll
这个文件你在哪调用了 导致没找到全局搜索该类调用 地方 看看是否误删
use
或者说 你的 console 目录下根本没有这个文件@PhoenixIcy 找到了,今天有点脑壳没转过来,我以为是laravel底层封装的类不在了