increase cache size

This commit is contained in:
2021-06-28 11:23:05 +05:00
parent b3f15c81b4
commit 642dcf5298
3 changed files with 5 additions and 5 deletions

View File

@@ -40,21 +40,21 @@ class HomeController extends Controller
});
$covid19 = config("karudhaas.topic_filters.covid19");
$covid19_articles = Cache::remember("home.articles.covid19", 600, function () use ($covid19) {
$covid19_articles = Cache::remember("home.articles.covid19", 3600, function () use ($covid19) { // Cache for an hour
return Article::with('source')->whereHas('topics', function ($q) use ($covid19) {
$q->whereIn('slug', $covid19["keys"]);
})->latest('published_date')->limit(5)->get();
});
$business = config("karudhaas.topic_filters.business");
$business_articles = Cache::remember("home.articles.business", 600, function () use ($business) {
$business_articles = Cache::remember("home.articles.business", 3600, function () use ($business) { // Cache for an hour
return Article::with('source')->whereHas('topics', function ($q) use ($business) {
$q->whereIn('slug', $business["keys"]);
})->latest('published_date')->limit(4)->get();
});
$sports = config("karudhaas.topic_filters.sports");
$sports_articles = Cache::remember("home.articles.sports", 600, function () use ($sports) {
$sports_articles = Cache::remember("home.articles.sports", 3600, function () use ($sports) { // Cache for an hour
return Article::with('source')->whereHas('topics', function ($q) use ($sports) {
$q->whereIn('slug',$sports["keys"]);
})->latest('published_date')->limit(4)->get();