/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * * @return mixed */ public function handle($request, Closure $next) { $response = $next($request); if (!$request->ajax()) { $v = View::make('boomcms::people.manager', ['groups' => Group::findAll(), 'content' => $response->getContent()]); $response->setContent($v); } return $response; }
/** * @return void */ public function handle() { $password = (string) new RandomPassword(); $this->credentials['password'] = Auth::hash($password); try { $person = Person::create($this->credentials); } catch (DuplicateEmailException $e) { } if (isset($person)) { foreach ($this->groups as $groupId) { $person->addGroup(Group::find($groupId)); } Event::fire(new AccountCreated($person, $password, Auth::getPerson())); return $person; } else { return Person::findByEmail($this->credentials['email']); } }
public function save() { $this->group->setName($this->request->input('name')); Group::save($this->group); }
public function removeGroup() { $group = Group::find($this->request->input('group_id')); $this->editPerson->removeGroup($group); }
public function addGroup() { return view("{$this->viewPrefix}/addgroup", ['person' => $this->editPerson, 'groups' => GroupFacade::allExcept($this->editPerson->getGroupIds())]); }
/** * View the page ACL settings. * * @param Page $page * * @return View */ public function index(Page $page) { $this->auth($page); return view('boomcms::editor.page.settings.acl', ['page' => $page, 'allGroups' => GroupFacade::findAll(), 'groupIds' => $page->getAclGroupIds()]); }
public function update(Request $request, GroupModel $group) { $group->setName($request->input('name')); GroupFacade::save($group); }