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

config('any');

 

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

 

 

解决办法:

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); 加载配置

 

相关文章:

  • 2018-04-07
  • 2022-12-23
  • 2022-12-23
  • 2021-06-30
  • 2021-10-14
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
猜你喜欢
  • 2021-09-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-04
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案