where('type', StaticPageType::we_move)->first(); $sectionModels = Section::query()->where('page_id', $staticPageModel->id)->get(); $newsModels = News::query()->where('published', true) ->orderBy('publish_at', 'DESC') ->limit(24) ->paginate(3); return view('fo.pages.news.index', \compact('staticPageModel', 'sectionModels', 'newsModels')); } /** * Display a news articles * * @param string $slug * @return \Illuminate\Contracts\View\View */ public function show(string $slug): \Illuminate\Contracts\View\View { /** @var \App\Models\News $newsModel */ $newsModel = News::query() ->where('published', true) ->where('slug', $slug) ->firstOrFail(); return view('fo.pages.news.show', \compact('newsModel')); } }