Lumen
Lumen#
Lumen
没有单独的发行版。为了在 Lumen
中使用 laravel-modules
,你必须手动设置它。
在根目录下创建一个配置文件夹,并将 vendor/nwidart/laravel-modules/config/config.php
复制到名为 modules.php
的文件夹中。
mkdir config
cp vendor/nwidart/laravel-modules/config/config.php config/modules.php
然后在 bootstrap/app.php
中加载配置文件和服务提供者
$app->configure('modules');
$app->register(\Nwidart\Modules\LumenModulesServiceProvider::class)
Laravel-modules 使用 path.public
这在 Lumen
中没有默认定义。
在加载服务提供者之前,注册 path.public
。
$app->bind('path.public', function() {
return __DIR__ . 'public/';
});
推荐文章: