keyBy(function (GeneralConfig $item) { return $item->type->value(); }); $legalsStaticPageModel = StaticPage::query()->where('type', StaticPageType::legals)->first(); $confidStaticPageModel = StaticPage::query()->where('type', StaticPageType::confidentiality)->first(); return view('fo.pages.home', compact('configList', 'legalsStaticPageModel', 'confidStaticPageModel')); } }