当前位置: 首页>>代码示例>>PHP>>正文


PHP User::latest方法代码示例

本文整理汇总了PHP中app\User::latest方法的典型用法代码示例。如果您正苦于以下问题:PHP User::latest方法的具体用法?PHP User::latest怎么用?PHP User::latest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\User的用法示例。


在下文中一共展示了User::latest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $users = User::latest()->paginate(2);
     $no = $users->firstItem();
     $subscription_data = Subscription::lists('subscription_name', 'id');
     return view('users.index', compact('users', 'no', 'subscription_data'));
 }
开发者ID:jasbirsingh-c,项目名称:sharemarket_web360,代码行数:12,代码来源:UsersController.php

示例2: index

 public function index()
 {
     if ($this->checkRestriction()) {
         return Redirect::to('/');
     }
     $users = User::latest()->get();
     return view('user.index', compact('users'));
 }
开发者ID:biswaupreti,项目名称:MobilityRequirements,代码行数:8,代码来源:UserController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $users = User::latest()->get();
     if ($request->ajax() || $request->wantsJson()) {
         return new JsonResponse($users);
     }
     return view('users.index', compact('users'));
 }
开发者ID:vergidul,项目名称:personal_project,代码行数:13,代码来源:UsersController.php

示例4: index

 /**
  * Show all users.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $users = User::latest('created_at')->get();
     if (Sentinel::hasAccess('admin')) {
         return view('admin.userlist', compact('users'));
     } else {
         return redirect('/');
     }
 }
开发者ID:ramigit3D,项目名称:article,代码行数:14,代码来源:UsersController.php

示例5: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $users = User::latest()->get();
     //Ci torna gli utenti in ordine cronologico secondo data di creazione
     /*		
     		if ($request->ajax() || $request->wantsJson()) {
         		return new JsonResponse($users);
         	}*/
     return view('users.index', compact('users'));
 }
开发者ID:khatiboss,项目名称:laravel-users-example,代码行数:15,代码来源:UsersController.php

示例6: manage

 public function manage()
 {
     if (Auth::guest()) {
         return redirect('/');
     } elseif (Auth::user()->level < 2) {
         return redirect('/');
     }
     $users = User::latest()->get();
     return view('users/manage', compact('users'));
 }
开发者ID:museuvirtual,项目名称:atlas,代码行数:10,代码来源:UsersController.php

示例7: adminIndex

 /**
  * Created By Dara on 6/11/2015
  * show list of credits for users in admin panel
  */
 public function adminIndex($user = null)
 {
     $users = [];
     if ($user != null) {
         $users[] = $user;
     } else {
         $users = User::latest()->with('roles')->paginate(20);
     }
     return view('admin.credit.index', compact('users'))->with(['title' => 'Balance management']);
 }
开发者ID:emadmrz,项目名称:Hawk,代码行数:14,代码来源:CreditController.php

示例8: index

 public function index()
 {
     $latestArticles = Article::latest()->take(6)->get();
     $latestPosts = Post::latest()->take(6)->get();
     $latestProblems = Problem::latest()->take(6)->get();
     $latestGroups = Group::latest()->take(6)->get();
     $latestUsers = User::latest()->take(6)->get();
     $ratedUsers = User::orderBy('rate', 'desc')->take(6)->get();
     $chartDatas = Comment::select([DB::raw('DATE(created_at) AS date'), DB::raw('COUNT(id) AS count')])->groupBy('date')->orderBy('date', 'ASC')->get()->toArray();
     return view('admin.dashboard.index', compact('latestArticles', 'latestPosts', 'latestProblems', 'latestGroups', 'latestUsers', 'ratedUsers', 'chartDatas'))->with(['title' => 'Admin Dashboard Panel']);
 }
开发者ID:emadmrz,项目名称:Hawk,代码行数:11,代码来源:DashboardController.php

示例9: users

 public function users(Request $request)
 {
     if (!$this->hasAccess($request)) {
         return Response()->json(['error' => 'Access denied.'], 500);
     }
     if (Gate::denies('admin')) {
         return Response()->json(['error' => 'Method not allowed'], 403);
     }
     // dd(User::latest()->with('publisher.territories')->get());
     return ['data' => $this->transformCollection(User::latest()->with('publisher.territories')->get(), 'user')];
 }
开发者ID:pierrestudios,项目名称:territory-api,代码行数:11,代码来源:PublishersController.php

示例10: dashboardForAdmin

 protected function dashboardForAdmin()
 {
     $data['user'] = $this->user;
     $data['total_users'] = User::where('role', 'user')->count();
     $data['total_token'] = Token::count();
     $data['total_admins'] = User::where('role', 'admin')->count();
     $data['total_apps'] = Application::count();
     $data['most_used_app'] = Application::getMostUsedApps();
     $data['most_active_app'] = Application::getMostActiveApps();
     $data['users'] = User::latest()->take(10)->get();
     $data['applications'] = Application::latest()->take(10)->get();
     $data['opt_app'] = Application::getAppForSelect($this->user);
     return view('dashboard.admin', $data);
 }
开发者ID:GreenHackers,项目名称:election-website,代码行数:14,代码来源:DashboardController.php

示例11: index

 public function index()
 {
     if (!\Auth::check()) {
         return redirect('home');
     }
     $userlist = User::latest('last_login_at')->where('email_verified', 1)->get();
     // Photos for Users
     $users = [];
     foreach ($userlist as $user) {
         $userlist_photo = $user->photos()->where('type', 'userlist')->orderBy('created_at', 'desc')->first() ?: [];
         // Need to fix this, because we are supposed to have picture when we register.
         // All users are supposed to have their pictures.
         if (empty($userlist_photo)) {
             $userlist_photo['path'] = '';
             $userlist_photo['type'] = '';
             $userlist_photo['name'] = '';
         }
         $userlist_photo['path'] = '/images/' . $user['id'] . '/' . $userlist_photo['type'] . '/' . $userlist_photo['name'];
         $users[] = array_add($user, 'userlist_photo', $userlist_photo);
     }
     return view('users.userlist', compact('users'));
 }
开发者ID:peco8,项目名称:senseicloud-1.0,代码行数:22,代码来源:UserController.php

示例12: index

 public function index()
 {
     $users = User::latest('name')->get();
     return view('users.index')->with('users', $users);
 }
开发者ID:arnoldllanes,项目名称:laracasts,代码行数:5,代码来源:UserController.php

示例13: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $users = $this->user->latest()->get();
     return response($users);
 }
开发者ID:xzxzyzyz,项目名称:laravel-websocket-sample,代码行数:10,代码来源:UserController.php

示例14: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     $users = User::latest('created_at')->paginate(10);
     return view('system.users.index', compact('users'));
 }
开发者ID:seahouse,项目名称:hxerp,代码行数:11,代码来源:UsersController.php

示例15: getAddUser

 public function getAddUser()
 {
     $users = User::latest()->take(3)->get();
     $roles = Role::lists('name', 'id')->all();
     return view('users.add-user', compact('users', 'roles'));
 }
开发者ID:Armen2004,项目名称:laravel-network,代码行数:6,代码来源:UMSController.php


注:本文中的app\User::latest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。