本文整理汇总了PHP中app\models\Category::paginate方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::paginate方法的具体用法?PHP Category::paginate怎么用?PHP Category::paginate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Category
的用法示例。
在下文中一共展示了Category::paginate方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: categories
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: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$categories = Category::paginate();
return view('categories.index', compact('categories'));
}
示例3: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$cats = Category::paginate(10);
return view('admin.goods_cats.index')->with('cats', $cats);
}
示例4: index
public function index()
{
$categories = Category::paginate(Config('constants.paginateNo'));
return view(Config('constants.adminCategoryView') . '.index', compact('categories'));
}
示例5: index
public function index()
{
$categories = Category::paginate(15);
return view('admin.category')->withCategories($categories);
}
示例6: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$categories = Category::paginate(20);
return view("dashboard.categories.index", compact("categories"));
}
示例7: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$categories = Category::paginate(8);
return view('categories.index', ['categories' => $categories]);
}
示例8: getIndex
public function getIndex()
{
return view('category.index',[
'categories' => Category::paginate()
]);
}
示例9: index
/**
* 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'));
}