categoryRepo = $categoryRepository; } /** * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function index() { $cat1 = $this->categoryRepo->findCategoryById(2); $cat2 = $this->categoryRepo->findCategoryById(3); return view('front.index', compact('cat1', 'cat2')); } }