Пример #1
0
 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();
 }
Пример #2
0
 /**
  * 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'));
 }
Пример #5
0
 public function index()
 {
     $categories = Category::paginate(15);
     return view('admin.category')->withCategories($categories);
 }
Пример #6
0
 /**
  * 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]);
 }
Пример #8
0
public function getIndex()
{
        return view('category.index',[
'categories' => Category::paginate()
]);
}
Пример #9
0
 /**
  * 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'));
 }