$staticPage, 'newsBreedingModels' => $newsBreedingModels, ]); } /** * Display the given breeding page. * * @return \Illuminate\Contracts\View\View */ public function ocbBreederPage(): \Illuminate\Contracts\View\View { $ocbBreederModels = OcbBreeder::getOcbBreederCards(); $staticPage = StaticPage::query()->where('type', StaticPageType::ouiCBon)->first(); $categoryApproachModels = CategoryApproach::all(); $sections = SectionApproach::query() ->with('category') ->where('page_id', $staticPage->id) ->get() ->groupBy(fn($section) => $section->category?->name); return view('fo.pages.breeding.oui-c-est-bon', [ 'ocbBreederModels' => $ocbBreederModels, 'staticPageModel' => $staticPage, 'categoryApproachModels' => $categoryApproachModels, 'sections' => $sections ]); } /** * Display the given breeding article. * * @param \App\Models\StaticPage $staticPage * @param \App\Models\NewsBreeding $newsBreeding * @return \Illuminate\Contracts\View\View */ public function breedingArticle(StaticPage $staticPage, NewsBreeding $newsBreeding): \Illuminate\Contracts\View\View { $asideNewsModels = NewsBreeding::query() ->whereHas('staticpage', function (Builder $query) use ($staticPage) { $query->where('type', $staticPage->type); }) ->where('published', true) ->whereNot('id', $newsBreeding->getKey()) ->inRandomOrder() ->limit(2) ->get(); return view('fo.pages.breeding.article', [ 'staticPageModel' => $staticPage, 'newsBreedingModel' => $newsBreeding, 'asideNewsModels' => $asideNewsModels ]); } /** * Display the given breeding page. * * @return \Illuminate\Contracts\View\View */ public function exitOutsidePage(): \Illuminate\Contracts\View\View { $staticPage = StaticPage::query()->where('type', StaticPageType::exitOutside)->first(); $sliderImages = CollectionHelper::mapSlidesToFields($staticPage->data); $categoryApproachModels = CategoryApproach::all(); $sections = SectionApproach::query() ->with('category') ->where('page_id', $staticPage->id) ->get() ->groupBy(fn($section) => $section->category?->name); return view('fo.pages.breeding.sortant-a-l-exterieur', [ 'staticPageModel' => $staticPage, 'sliderImages' => $sliderImages, 'categoryApproachModels' => $categoryApproachModels, 'sections' => $sections, ]); } /** * Display our farms page. * * @return \Illuminate\Contracts\View\View */ public function ourFarmsPage(): \Illuminate\Contracts\View\View { $staticPage = StaticPage::query()->where('type', StaticPageType::ourFarms)->first(); return view('fo.pages.breeding.index', ['staticPageModel' => $staticPage]); } }