/** * For sub-classes to add extra fields or remove fields * * @return array */ protected function innerFields() { $fields = ['role_id' => ['type' => 'select', 'label' => 'role', 'options' => Role::dropdown()]]; if ($this->isEditing()) { $fields += $this->passwordFields(); } return $fields; }
/** * Drop down of all roles * * @return array */ public static function dropdown() { return Role::lists('name', 'id'); }
/** * Users index page (List current users) * * @param Role $role * * @return \Illuminate\View\View */ public function getIndex(Role $role) { return view('administration.users.index', ['projects' => $this->auth->user()->projects()->get(), 'roles' => $role->rolesWithUsers()]); }