本文整理汇总了PHP中app\models\User::paginate方法的典型用法代码示例。如果您正苦于以下问题:PHP User::paginate方法的具体用法?PHP User::paginate怎么用?PHP User::paginate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\User
的用法示例。
在下文中一共展示了User::paginate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index(Request $request)
{
if ($request->input('q')) {
}
$users = User::paginate(50);
return view('admin.users.index', compact('users'));
}
示例2: 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'));
}
示例3: index
public function index($request, $response, $args)
{
$pageNum = 1;
if (isset($request->getQueryParams()["page"])) {
$pageNum = $request->getQueryParams()["page"];
}
$users = User::paginate(15, ['*'], 'page', $pageNum);
$users->setPath('/admin/user');
return $this->view()->assign('users', $users)->display('admin/user/index.tpl');
}
示例4: getPaginated
/**
* Get a cached paginated result
*
* @param $perPage
* @return mixed
*/
public function getPaginated($perPage)
{
$page = Request::get('page');
if (!$page) {
$page = 0;
}
$cacheKey = 'laradmin_users_page' . $page;
return Cache::tags('laradmin_users')->remember($cacheKey, 60, function () use($perPage) {
return User::paginate($perPage);
});
}
示例5: index
public function index(Request $request)
{
$users = User::paginate(10);
$roles = DB::table('roles')->lists('role_name', 'id');
$viewData = array('users' => $users, 'roles' => $roles);
$userId = $request->get('id');
$action = $request->get('action');
if ($action == 'delete') {
return $this->delete($userId);
}
if ($action == 'accept') {
return $this->accept($userId);
}
if ($userId) {
$user = User::find($userId);
$viewData['user'] = $user;
}
return view('admin.user', $viewData);
}
示例6: displayAdminPage
/**
* Show the admin panel, and process admin AJAX requests.
*
* @return Response
*/
public function displayAdminPage(Request $request)
{
if (!$this->isLoggedIn()) {
return abort(404);
}
$username = session('username');
$role = session('role');
$admin_users = null;
$admin_links = null;
if ($this->currIsAdmin()) {
$admin_users = User::paginate(15);
$admin_links = Link::paginate(15);
}
$user = UserHelper::getUserByUsername($username);
if (!$user) {
return redirect(route('index'))->with('error', 'Invalid or disabled account.');
}
$user_links = Link::where('creator', $username)->paginate(15);
return view('admin', ['role' => $role, 'admin_users' => $admin_users, 'admin_links' => $admin_links, 'user_links' => $user_links, 'api_key' => $user->api_key, 'api_active' => $user->api_active, 'api_quota' => $user->api_quota]);
}
示例7: index
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
*
* @see https://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
User::create(['name' => 'test' . uniqid(), 'email' => 'test' . uniqid() . '@test.com', 'password' => md5('test' . uniqid())]);
$users = User::paginate(5);
$this->output->set_output(View::make('users', compact('users')));
}
示例8: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$users = User::paginate(10);
return view('admin.users.index', compact('users'));
}
示例9: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return User::paginate(10);
}
示例10: getManage
public function getManage()
{
$this->middleware('admin');
$users = User::paginate(20);
return view('admin.users.manage', ['pageInfo' => ['siteTitle' => 'Manage Users', 'pageHeading' => 'Manage Users', 'pageHeadingSlogan' => 'Here the section to manage all registered users'], 'data' => ['users' => $users]]);
}
示例11: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return view('admin.users.list', array('data' => User::paginate(10)));
}
示例12: listing
public function listing($page, $limit)
{
$response = array('data' => array(), 'paginator' => '');
if (!empty($limit)) {
$users = User::paginate($limit);
} else {
$users = User::where('id', '>', '0')->get();
}
if (!empty($users)) {
foreach ($users as $key => $user) {
$response['data'][] = $this->get($user->id, false);
}
}
if (!empty($limit)) {
$response = Utility::paginator($response, $users, $limit);
}
return $response;
}
示例13: index
/**
* @api {get} /users 用户列表
* @apiDescription 当前用户信息
* @apiGroup user
* @apiPermission none
* @apiVersion 0.1.0
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 200 OK
* {
* "data": [
* {
* "id": 2,
* "email": "490554191@qq.com",
* "name": "fff",
* "created_at": "2015-11-12 10:37:14",
* "updated_at": "2015-11-13 02:26:36",
* "deleted_at": null
* }
* ],
* "meta": {
* "pagination": {
* "total": 1,
* "count": 1,
* "per_page": 15,
* "current_page": 1,
* "total_pages": 1,
* "links": []
* }
* }
* }
*/
public function index()
{
$users = User::paginate();
return $this->response->paginator($users, new UserTransformer());
}
示例14: index
public function index()
{
$system_users = User::paginate(Config('constants.paginateNo'));
$roles = Role::get(['id', 'name'])->toArray();
return view(Config('constants.adminSystemUsersView') . '.index', compact('system_users', 'roles'));
}
示例15: users
public function users()
{
$users = User::paginate(10);
return view('users', array('users' => $users));
}