FIX: fix bug related to settings cache

This commit is contained in:
Michal Kváček
2017-08-02 18:35:48 +02:00
parent 3a1e4b9c5b
commit 25d9ded124
6 changed files with 17 additions and 4 deletions
+6 -2
View File
@@ -1,9 +1,11 @@
<?php
namespace App\CMS\Repositories;
use App\CMS\Contracts\Repositories\Module as IModule;
use App\Models\Content\Content;
use App\Models\Module as ModuleModel;
use Illuminate\Support\Facades\Cache;
class Module extends Repository implements IModule
{
@@ -52,8 +54,10 @@ class Module extends Repository implements IModule
public function all()
{
return ModuleModel::where('enabled', true)
->get();
return Cache::rememberForever('enabled-modules-and-template', function () {
return ModuleModel::where('enabled', true)
->get();
});
}
public function getByHandler($handler)