public function getRanking($iso = false) { $this->user->pushCriteria(new OrderBy('points')); if (!$iso) { $users = $this->user->all()->take(32); $title = trans('user::ui.ranking.global'); } else { $country = $this->country->findByField('iso2', $iso)->first(); $users = $this->user->findWhere(['country_id' => $country->id]); $title = trans('user::ui.ranking.country', ['country' => $country->short_name]); } return theme('user.learning.ranking', compact('users', 'title')); }
public function compose($view) { $this->user->pushCriteria(new UserOrderCriteria()); $view->users = $this->user->all(); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $this->user->pushCriteria(new UserOrderCriteria()); $users = $this->user->all(); return view('user::backend.users.index', compact('users', 'currentUser')); }