select('id', 'category', 'pinned', 'title', 'created_at') ->orderByDesc('pinned') ->orderByDesc('created_at') ->paginate(20); return view('info.index')->with([ 'informations' => $informations, 'categories' => Information::CATEGORIES ]); } public function show($id) { $information = Information::findOrFail($id); return view('info.show')->with([ 'info' => $information, 'category' => Information::CATEGORIES[$information->category] ]); } }