Overriding configuration files of composer packages in Lumen
我有一个安装了外部Composer软件包的Lumen项目。与Lumen一样,它们存储在
我在注册应用程序本身之后立即使用
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | require_once __DIR__ . '/../vendor/autoload.php'; try { (new Dotenv\\Dotenv(__DIR__ . '/../'))->load(); } catch (Dotenv\\Exception\\InvalidPathException $e) { // } $app = new Laravel\\Lumen\\Application( realpath(__DIR__ . '/../') ); $app->withFacades(); $app->withEloquent(); $app->configure('/Configuration/Lumen/app.php'); $app->configure('/Configuration/Lumen/auth.php'); $app->configure('/Configuration/Tymon/jwt.php'); |
文件位于各自的目录中,并且包含我希望流明使用的设置,而不是分别位于以下位置的默认设置:
1 2 3 | /vendor/laravel/lumen-framework/config/app.php /vendor/laravel/lumen-framework/config/auth.php /vendor/tymon/jwt-auth/config/config.php |
我遇到的问题是在这种配置下,Lumen似乎忽略了我的自定义文件,而是使用默认值。我在这里做错什么了吗?
将配置文件放在
1 2 | // Your custom config in config/jwt-auth.php $app->configure('jwt-auth'); |