all() public method

Get all Categories.
public all ( ) : mixed
return mixed
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $categories = $this->categoryRepository->all();
     return view('categories.index', compact('categories'));
 }
Esempio n. 2
0
 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'));
 }