Try to add the page number to the cache identificator. When use pagination the "page" parameter is added after the first page:
$page=1; //Default value
if($request->get('page')){
$page = $request->get('page');
}
Then:
Redis::set("categories:admin:{$page}",$test2);
And to obtain:
Redis::get("categories:admin:{$page}");
Hope it works.
Do not forget to check the Laravel course may helps to improve your skills: Laravel and RESTful
Best wishes.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community