如何在 lumen 中设置配置文件系统?

How can I set the config filesystem in lumen?

我想在lumen中配置文件系统路径,而lumen没有提供config文件夹设置文件系统本地路径怎么办?

在注册服务提供商之前,将以下内容放入您的 bootstrap/app.php 中:

$app->instance('path.config', app()->basePath() . DIRECTORY_SEPARATOR . 'config');

您也可以对其他变量执行此操作,例如 path.storagepath.public

这是在 Laravel 中默认设置的,但在 Lumen 中没有设置。因此,您需要自己将其添加到 bootstrap 进程中。