FIX: fix registering service providers in templates

This commit is contained in:
Michal Kváček
2017-08-26 22:34:40 +02:00
parent 6468c8f49c
commit c92ba41def
4 changed files with 26 additions and 48 deletions
@@ -16,7 +16,7 @@ class ModuleManager extends ServiceProvider
{
// this service provider needs published config - config is merged right after this service provider
try {
$modules = app(ModuleRepository::class)->getOnlyModules();
$modules = app(ModuleRepository::class)->all();
} catch (QueryException $e) {
return;
}
@@ -32,7 +32,13 @@ class ModuleManager extends ServiceProvider
// include files (if any)
if (isset($module->module_settings['files']) && !empty($module->module_settings['files'])) {
foreach ($module->module_settings['files'] as $file) {
include config('modules.paths.modules') . '/' . $module->static_name . '/' . $file;
$path = config('modules.paths.modules') . '/' . $module->static_name . '/' . $file;
if (!file_exists($path)) {
$path = base_path($file);
}
@include_once $path;
}
}
}