public function categories($search = null, $paginate = true) { $result = null; if ($paginate) { if (!is_null($search) && !empty($search)) { return Category::where('name', 'like', "%{$search}%")->paginate(env('PAGINATION_ITEMS', 10)); } return Category::paginate(env('PAGINATION_ITEMS', 10)); } /** * Este, sem paginação, visa atender à API */ return Category::where('name', 'like', "%{$search}%")->get(); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $categories = Category::paginate(); return view('categories.index', compact('categories')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $cats = Category::paginate(10); return view('admin.goods_cats.index')->with('cats', $cats); }
public function index() { $categories = Category::paginate(Config('constants.paginateNo')); return view(Config('constants.adminCategoryView') . '.index', compact('categories')); }
public function index() { $categories = Category::paginate(15); return view('admin.category')->withCategories($categories); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $categories = Category::paginate(20); return view("dashboard.categories.index", compact("categories")); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $categories = Category::paginate(8); return view('categories.index', ['categories' => $categories]); }
public function getIndex() { return view('category.index',[ 'categories' => Category::paginate() ]); }
/** * Returns list of all categories * * @return View */ public function index() { // Select all categories with pagination, 15 categories per page $categories = Category::paginate(15); return view('admin.categories.index')->with(compact('categories')); }