vendredi 11 mars 2016

Laravel 5 - Cache remember doesn't work

I have tried to cache some queries with Cache::remember(); but it doesn't work. My script response code is 500(Internal Server Error).

Here is my code:

$filters = \Cache::remember("cache_filter", 20, function(){
     $data['value1'] = MyClass::where('<condition>')->get();
     $data['value2'] = MyClass::where('<condition>')->get();
     $data['value3'] = MyClass::where('<condition>')->get();

     return $data;
});

return view('custom.show')->with($filters);

Storage permissions => 777
Cache path => storage_path('framework/cache')

Does anyone have an idea?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire