laravel 命令行测试 Uncaught ReflectionException: Class config does not exist

 

require __DIR__ . '/vendor/autoload.php';
$app = require_once __DIR__ . '/bootstrap/app.php';

config('any');

 

 

 

解决办法:

require __DIR__ . '/vendor/autoload.php';
$app = require_once __DIR__ . '/bootstrap/app.php';

(new \Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
config('any');

 使用 (new \Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app); 加载配置

 

posted @ 2019-03-05 10:37  佚名000  阅读(2624)  评论(0编辑  收藏  举报