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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM