Support the ongoing development of Laravel.io →
Cache Eloquent Blade
Last updated 2 years ago.
0

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.

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

petyots petyots Joined 12 Sep 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.