Exemplo n.º 1
0
 /**
  * @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']);
     }
 }
Exemplo n.º 2
0
 public function removeGroup()
 {
     $group = Group::find($this->request->input('group_id'));
     $this->editPerson->removeGroup($group);
 }