cache bug fix

This commit is contained in:
2020-08-24 18:57:43 +05:00
parent 4bc1f5448e
commit d3ae5de10b
3 changed files with 6 additions and 3 deletions

View File

@@ -17,7 +17,8 @@ final class RecentArticles extends Controller
*/
public function __invoke()
{
return Cache::remember('articles.recent', 300, function () {
$currentPage = request()->get('page',1);
return Cache::remember('articles.recent_'.$currentPage, 300, function () {
return [
"articles" => Article::with('source', 'topics')
->latest("published_date")