/** * Display entities... all 'kinds' * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function index() { // eager loading the 'kind' relationship to // reduce the number of queries called in the view $entities = Entity::with(['kind' => function ($query) { $query->orderBy('id', 'desc'); }])->paginate(20); return view('entities.index', compact('entities')); }