示例#1
0
 /**
  * Show a table of users.
  *
  * @return \Illuminate\Http\JsonResponse
  */
 public function index()
 {
     if ($this->input('search')) {
         $this->users->search($this->input('search'));
     }
     if ($this->input('usertype')) {
         $this->users->filter($this->input('usertype'));
     }
     $users = $this->users->paginate(20)->getAll();
     return $this->jsonResponse(['users' => $users]);
 }
示例#2
0
 /**
  * Show a table of users.
  *
  * @return \Illuminate\View\View
  */
 public function index()
 {
     if ($this->input('search')) {
         $this->users->search($this->input('search'));
     }
     if ($this->input('usertype')) {
         $this->users->filter($this->input('usertype'));
     }
     $users = $this->users->paginate(20)->getAll();
     $types = ['' => Lang::get('c::user.usertypes-all')] + $this->getUserTypes();
     return $this->view('c::user.list', ['users' => $users, 'userTypes' => $types, 'bulkActions' => $this->getBulkActions(), 'showAction' => $this->action('show'), 'editAction' => $this->action('edit'), 'switchAction' => $this->canSwitchUser() ? $this->action('switchUser') : null, 'newUrl' => $this->url('create'), 'backUrl' => URL::to('/')]);
 }