本文整理匯總了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'));
}
示例2: index
public function index()
{
$users = Cache::remember('users1', 60, function () {
return User::paginate(20);
});
return view('profile.index', compact('users'));
}
示例3: index
public function index()
{
$items = User::paginate();
//dd($items);
$items->setPath('user');
return View::make('admin.user.view_user', compact('items'));
}
示例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();
}
示例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]);
}
示例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'));
}
示例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'));
}
示例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']);
}
示例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));
}
示例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'));
}
示例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);
}
示例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}"));
}
示例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'));
}
示例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'));
}
示例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]);
}