當前位置: 首頁>>代碼示例>>PHP>>正文


PHP User::paginate方法代碼示例

本文整理匯總了PHP中app\User::paginate方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::paginate方法的具體用法?PHP User::paginate怎麽用?PHP User::paginate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\User的用法示例。


在下文中一共展示了User::paginate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //Numero entre parentesis, declara la cantidad de registros que deseas ver en la pagina
     $users = User::paginate(10);
     //<-------
     return view('admin.users.index', compact('users'));
 }
開發者ID:PacoFigueroa,項目名稱:loginlaravel,代碼行數:12,代碼來源:UsersController.php

示例2: index

 public function index()
 {
     $users = Cache::remember('users1', 60, function () {
         return User::paginate(20);
     });
     return view('profile.index', compact('users'));
 }
開發者ID:AdrianKuriata,項目名稱:projekt,代碼行數:7,代碼來源:ProfileController.php

示例3: index

 public function index()
 {
     $items = User::paginate();
     //dd($items);
     $items->setPath('user');
     return View::make('admin.user.view_user', compact('items'));
 }
開發者ID:alexlondon07,項目名稱:AprendiendoLaravel5,代碼行數:7,代碼來源:UserController.php

示例4: renderPagination

 protected function renderPagination($total = 55, $perPage = 10, $theme = 'bootstrap')
 {
     factory(User::class, $total)->create();
     $users = User::paginate($perPage);
     $users->setPath($this->path . $theme . '/');
     return $users->render();
 }
開發者ID:sirlanse,項目名稱:blade-pagination-tests,代碼行數:7,代碼來源:PaginationTest.php

示例5: users

 public function users()
 {
     if (Gate::denies('all-users')) {
         abort(403);
     }
     $users = User::paginate(20);
     $suspended = $users->where('role', 'suspended')->count();
     $active = $users->where('role', 'active')->count();
     $rush = $users->where('role', 'rush')->count();
     $admin = $users->where('role', 'admin')->count();
     $superadmin = $users->where('role', 'superadmin')->count();
     $suspended_queries = Project::whereHas('user', function ($project) {
         // $suspended_queries = Query::whereHas( 'user', function ($query) {
         $project->where('role', '=', 'suspended');
     })->count();
     $active_queries = Project::whereHas('user', function ($project) {
         // $active_queries = Query::whereHas( 'user', function ($query) {
         $project->where('role', '=', 'active');
     })->count();
     $rush_queries = Project::whereHas('user', function ($project) {
         // $rush_queries = Query::whereHas( 'user', function ($query) {
         $project->where('role', '=', 'rush');
     })->count();
     $admin_queries = Project::whereHas('user', function ($project) {
         // $admin_queries = Query::whereHas( 'user', function ($query) {
         $project->where('role', '=', 'admin');
     })->count();
     $superadmin_queries = Project::whereHas('user', function ($project) {
         // $superadmin_queries = Query::whereHas( 'user', function ($query) {
         $project->where('role', '=', 'superadmin');
     })->count();
     return view('users', ['users' => $users, 'suspended' => $suspended, 'active' => $active, 'rush' => $rush, 'admin' => $admin, 'superadmin' => $superadmin, 'suspended_queries' => $suspended_queries, 'active_queries' => $active_queries, 'rush_queries' => $rush_queries, 'admin_queries' => $admin_queries, 'superadmin_queries' => $superadmin_queries]);
 }
開發者ID:hvs-fasya,項目名稱:seo_padawan,代碼行數:33,代碼來源:UserController.php

示例6: postSearch

 public function postSearch(Request $request)
 {
     if (!$request->name and !$request->email) {
         $models = User::paginate(10);
     }
     if ($request->name) {
         $models = User::where('name', 'like', '%' . $request->name . '%')->paginate(10);
     }
     if ($request->email) {
         $models = User::where('email', 'like', '%' . $request->email . '%')->paginate(10);
     }
     if ($request->name and $request->email) {
         $models = User::where('name', 'like', '%' . $request->name . '%')->where('email', 'like', '%' . $request->email . '%')->paginate(10);
     }
     if ($request->role_list) {
         $models = Role::find($request->role_list)->users()->paginate(10);
     }
     if ($request->role_list and $request->name) {
         $models = Role::find($request->role_list)->users()->where('name', 'like', '%' . $request->name . '%')->paginate(10);
     }
     if ($request->role_list and $request->email) {
         $models = Role::find($request->role_list)->users()->where('email', 'like', '%' . $request->email . '%')->paginate(10);
     }
     if ($request->role_list and $request->email and $request->name) {
         $models = Role::find($request->role_list)->users()->where('name', 'like', '%' . $request->name . '%')->where('email', 'like', '%' . $request->email . '%')->paginate(10);
     }
     $model = new User();
     $model->name = $request->name;
     $model->email = $request->email;
     $model->role_list = $request->role_list;
     $roles = Role::lists('name', 'id');
     $roles[''] = 'нет';
     return view('admin.user.index', compact('models', 'model', 'roles'));
 }
開發者ID:Ravend6,項目名稱:laravel_base_v5.2,代碼行數:34,代碼來源:UserController.php

示例7: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $users = "";
     User::paginate();
     //dd ($users);
     return view('admin.users.catPuesto', compact('users'));
 }
開發者ID:javierTerry,項目名稱:homeblack,代碼行數:12,代碼來源:PuestoController.php

示例8: index

 /**
  * List all users resource.
  * 
  * Get a JSON representation of all the registered users.
  *
  */
 public function index()
 {
     // $users = User::all();
     // return $this->response->collection($users, new UserTransformer, ['key' => 'users']);
     // Or Paginated
     $users = User::paginate(25);
     return $this->response->paginator($users, new UserTransformer(), ['key' => 'users']);
 }
開發者ID:yeets,項目名稱:lumen-api,代碼行數:14,代碼來源:UserController.php

示例9: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     if ($request->has('q')) {
         $q = $request->input('q');
         return view('backend.users.inde')->withUsers(User::search($q)->paginate(5));
     }
     return view('backend.users.inde')->withUsers(User::paginate(5));
 }
開發者ID:soarmorrow,項目名稱:grabage-collector,代碼行數:13,代碼來源:UsersController.php

示例10: index

 public function index(Request $request)
 {
     if ($request->input('name')) {
         $userlist = User::where('name', 'like', '%' . $request->input('name') . '%')->paginate(10);
     } else {
         $userlist = User::paginate(10);
     }
     return view('admin.user.index', compact('userlist'));
 }
開發者ID:realphp,項目名稱:laravel-cms,代碼行數:9,代碼來源:UserController.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $page = 'user.index';
     //Paginator::setCurrentPage($page);
     //Paginator::setBaseUrl($baseUrl);
     //Paginator::setPageName('page');
     $users = User::paginate($this->pagination);
     return view($page)->with('users', $users);
 }
開發者ID:brahmantyo,項目名稱:master,代碼行數:14,代碼來源:UserController.php

示例12: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $title = $this->title;
     $module_name = $this->module_name;
     $module_icon = $this->module_icon;
     $page_heading = "All Users";
     ${$module_name} = User::paginate(5);
     return view("backend.{$module_name}.index", compact('title', 'page_heading', 'module_icon', "module_name", "{$module_name}"));
 }
開發者ID:nasirkhan,項目名稱:laravel-5-starter,代碼行數:14,代碼來源:UsersController.php

示例13: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Request::get('filter')) {
         $records = User::where('title', 'LIKE', '%' . Request::get('filter') . '%')->paginate(10);
     } else {
         $records = User::paginate(10);
     }
     return view('back::scope.system.users.index', compact('records'));
 }
開發者ID:rdehnhardt,項目名稱:rdehnhardt,代碼行數:14,代碼來源:UsersController.php

示例14: getIndex

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     $users = User::paginate(15);
     if (\Request::has('key')) {
         $key = \Request::input('key');
         $users = User::where('name', 'like', '%' . $key . '%')->paginate(15);
     }
     return view('admin.user.index', compact('users'));
 }
開發者ID:jay4497,項目名稱:j4cms,代碼行數:14,代碼來源:UserController.php

示例15: getUsers

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function getUsers()
 {
     // $result = \DB::table('users')
     //                 ->select('name','type')
     //                 ->get();
     $result = User::paginate();
     // dd($result);
     return view('prueba.user', ['array' => $result]);
 }
開發者ID:slopcri,項目名稱:Laravel_Local,代碼行數:14,代碼來源:UserController.php


注:本文中的app\User::paginate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。