我尝试使用Cache::remember()缓存一些查询结果,但它没有起作用。
我的脚本响应代码是500(内部服务器错误)。
这是我的代码:
$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);
存储
权限 => 777
缓存路径
=> storage_path('framework/cache')
有人有想法吗?