cache bug fix
This commit is contained in:
@@ -30,7 +30,8 @@ class TopicsAPIController extends Controller
|
||||
*/
|
||||
public function show(Topic $topic)
|
||||
{
|
||||
return Cache::remember('topic_'.$topic->slug, 300, function () use ($topic) {
|
||||
$currentPage = request()->get('page',1);
|
||||
return Cache::remember($topic->slug. '_'.$currentPage, 300, function () use ($topic) {
|
||||
return response()->json([
|
||||
'topic' => new TopicResource($topic),
|
||||
'articles' => $topic->articles()->with('source')->latest('published_date')->paginate(8)
|
||||
|
Reference in New Issue
Block a user