Mar 16, 2015
0
Level 14
Pagination Query With Cache
Hello everybody
I'm trying to cache search results with Pagination but i always get error
this is my code
$result = Cache::remember($stmt, 1440, function() use($title,$section,$state,$city) {
$services = Services::where('service_name', 'LIKE', '%' . $title . '%')
->where('service_city', 'LIKE', '%'.$city.'%')
->where('service_state', 'LIKE', '%'.$state.'%')
->where('service_section', 'LIKE', '%' . $section . '%')
->paginate(8);
return $services;
});
The result is :
Serialization of 'Closure' is not allowed
how to fix it , please ? :)
Please or to participate in this conversation.