/** * Display a listing of the resource. * * @return Response */ public function index() { $categories = $this->categoryRepository->all(); return view('categories.index', compact('categories')); }
public function homePage(ProductRepository $products, CategoryRepository $categories) { return view('admin.main')->with('products', $products->paginate())->with('cats', $categories->all(['name']))->with('homegrids', HomeGrid::all()); }
/** * Get all categories used to group posts. * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function groupByCategory() { $categories = $this->category->all(); return view('front.archive.category', compact('categories')); }