FEATURE: hide menu entry when no content modules are available

This commit is contained in:
Michal Kváček
2017-08-22 22:35:48 +02:00
parent 7d847cbab9
commit e0b5559b96
12 changed files with 33 additions and 28 deletions
+11 -2
View File
@@ -28,6 +28,15 @@ class Module extends Repository implements IModule
}
}
public function getContentModules()
{
return Cache::remember('enabled-content-modules', 3600, function () {
return ModuleModel::where('enabled', true)
->where('manages_content', true)
->get();
});
}
public function getCreateContentTitle(ModuleModel $module)
{
$pageHeading = trans('admin/contents.new', ['name' => trans($module->name)]);
@@ -64,8 +73,8 @@ class Module extends Repository implements IModule
{
return Cache::rememberForever('enabled-modules', function () {
return ModuleModel::where('enabled', true)
->where('is_template', false)
->get();
->where('is_template', false)
->get();
});
}