Beispiel #1
0
 public function getDealers($code)
 {
     $brand = Brand::whereBrandCode($code)->first();
     $dealerIds = $brand->users()->lists('user_id')->toArray();
     $users = User::with('profile')->whereIn('id', $dealerIds)->get();
     return \Fractal::collection($users, new UserTransformer())->getArray();
 }
Beispiel #2
0
 public function getPaginate()
 {
     $take = 40;
     return User::with(['entity' => function ($q) use($take) {
         $q->take($take);
         $q->orderBy('created_at', 'DESC');
     }, 'town', 'organization'])->paginate(8);
 }
Beispiel #3
0
 public function index()
 {
     $users = User::with('profile')->latest()->simplePaginate(20);
     return view('users.lists')->with(compact('users'));
 }