Hi,
I'm trying to get Cache working, but whenever I call to any of its methods as described in docs (get, put, has,..) I get an error:
Call to undefined method Illuminate\Support\Facades\Cache::has()
My code is:
Route::get('/test', function(){
if (Cache::has('somedata'))
{
$somedatas = Cache::get('somedata');
}
else
{
$somedatas = Somedata::all();
Cache::add('somedata', $somedatas, 525949); // for a year
}
...
});
UPDATE: when trying to make
$users = User::with('prop')->remember(10)->get();
I also get an error:
Class cache does not exist
and when trying to create cache instance by
$c = new Cache;
I get
Call to undefined method Illuminate\Support\Facades\Cache::driver()
I would appreciate any help.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community