fr', 'evenement') ->whereNull('deleted_at') ->value('id'); #FIXME: REPLACE CATEGORY PAR TAG }); $this->nextEvents = Cache::remember("{$locale}_newsNextEvents", 86400, function () use ($eventCategoryId) { return News::getPublishedNewsInCurrentLocale() ->where('status', NewsStatusEnum::published)->with('categories') ->whereHas('categories', function ($query) use ($eventCategoryId) { $query->where('category_id', $eventCategoryId); #FIXME: WHERE CATEGORY IS 'Actualites' AND WHERE TAG IS '3 (evenement)' }) ->latest() ->take(3) ->get(); }); } /** * Get the view / contents that represent the component. */ public function render(): View|Closure|string { return view('components.front.news.news-next-event-component', [ 'nextEvents' => $this->nextEvents ]); } }