diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index dbc4099..6be54b2 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -17,7 +17,7 @@ class HomeController extends Controller */ public function __invoke(Request $request) { - $todays_pick = Cache::store('redis')->remember('home.todayspick', 600, function () { + $todays_pick = Cache::remember('home.todayspick', 600, function () { return Article::with('topics', 'source') ->whereDate('published_date', Carbon::today()) ->inRandomOrder() @@ -40,21 +40,21 @@ class HomeController extends Controller }); $covid19 = config("karudhaas.topic_filters.covid19"); - $covid19_articles = Cache::store('redis')->remember("home.articles.covid19", 600, function () use ($covid19) { + $covid19_articles = Cache::remember("home.articles.covid19", 600, function () use ($covid19) { 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::store('redis')->remember("home.articles.business", 600, function () use ($business) { + $business_articles = Cache::remember("home.articles.business", 600, function () use ($business) { 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::store('redis')->remember("home.articles.sports", 600, function () use ($sports) { + $sports_articles = Cache::remember("home.articles.sports", 600, function () use ($sports) { return Article::with('source')->whereHas('topics', function ($q) use ($sports) { $q->whereIn('slug',$sports["keys"]); })->latest('published_date')->limit(4)->get(); diff --git a/app/Http/Controllers/NameSpaceController.php b/app/Http/Controllers/NameSpaceController.php index a85242f..3913371 100644 --- a/app/Http/Controllers/NameSpaceController.php +++ b/app/Http/Controllers/NameSpaceController.php @@ -19,7 +19,7 @@ class NameSpaceController extends Controller $options = config("karudhaas.topic_filters." . $namespace); - $articles = Cache::store('redis')->remember("articles.$namespace", 600, function () use ($options) { + $articles = Cache::remember("articles.$namespace", 600, function () use ($options) { return Article::with('source')->whereHas('topics', function ($q) use ($options) { $q->whereIn('slug', $options["keys"]); })->latest('published_date')->limit(8)->get();