Exemple #1
0
 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'));
 }
 /**
  *
  */
 private function emptyUserTables()
 {
     foreach ($this->user->all() as $user) {
         $this->user->delete($user->id);
     }
     foreach ($this->role->all() as $role) {
         $this->role->delete($role->id);
     }
 }
Exemple #3
0
 public function compose($view)
 {
     $this->user->pushCriteria(new UserOrderCriteria());
     $view->users = $this->user->all();
 }
Exemple #4
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $users = $this->user->all();
     $currentUser = $this->auth->check();
     return view('user::admin.users.index', compact('users', 'currentUser'));
 }
Exemple #5
0
 /**
  * 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'));
 }
Exemple #6
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $users = $this->user->all();
     return $this->response->collection($users, new UserTransformer());
 }