Exemplo n.º 1
0
 /**
  * Execute the job.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Apolune\Contracts\Account\Account|null
  */
 public function handle(Request $request)
 {
     $this->account->password = bcrypt($request->get('password'));
     $this->account->save();
     event(new ChangedPassword($this->account));
     return $this->account;
 }
Exemplo n.º 2
0
 /**
  * Execute the job.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Apolune\Contracts\Account\Account|null
  */
 public function handle(Request $request)
 {
     $this->account->email = $request->get('email');
     $this->account->save();
     event(new UnconfirmedAccount($this->account));
     return $this->account;
 }
Exemplo n.º 3
0
 /**
  * Execute the job.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Apolune\Contracts\Account\Account|null
  */
 public function handle(Request $request)
 {
     $this->account->name = $request->get('name');
     $this->account->save();
     event(new RenamedAccount($this->account));
     return $this->account;
 }
Exemplo n.º 4
0
 /**
  * Execute the job.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Apolune\Contracts\Account\Account|null
  */
 public function handle(Request $request)
 {
     $this->account->load('properties');
     $this->account->properties->email = $request->get('email');
     $this->account->properties->email_date = Carbon::now();
     $this->account->properties->save();
     event(new ChangeRequested($this->account));
     return $this->account;
 }
Exemplo n.º 5
0
 /**
  * Execute the job.
  *
  * @return \Apolune\Contracts\Account\Account|null
  */
 public function handle()
 {
     $this->account->load('properties');
     if ($this->account->properties->emailRequests() >= 2) {
         return null;
     }
     $this->account->properties->email_requests += 1;
     $this->account->properties->save();
     event(new VerificationCodeRequested($this->account));
     return $this->account;
 }
Exemplo n.º 6
0
 /**
  * Execute the job.
  *
  * @return \Apolune\Contracts\Account\Account|null
  */
 public function handle()
 {
     $this->account->load('players');
     $this->account->properties->deleted = Carbon::now();
     $this->account->properties->save();
     foreach ($this->account->players as $player) {
         $this->dispatch(new DeletePlayer($player));
     }
     event(new TerminatedAccount($this->account));
     return $this->account;
 }
Exemplo n.º 7
0
 /**
  * Execute the job.
  *
  * @return \Apolune\Contracts\Account\Account|null
  */
 public function handle()
 {
     $password = str_random(rand(8, 10));
     $this->account->email = $this->account->properties->email();
     $this->account->password = bcrypt($password);
     $this->account->properties->email = null;
     $this->account->properties->email_date = null;
     $this->account->push();
     event(new RequestAccepted($this->account, $password));
     return $this->account;
 }
Exemplo n.º 8
0
 /**
  * Execute the job.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Apolune\Contracts\Account\Player|null
  */
 public function handle(Request $request)
 {
     $player = app('player');
     $player->name = ucwords(strtolower($request->get('player')));
     $player->account_id = $this->account->id();
     $player->vocation = $request->get('vocation', vocations(true)->first()->id());
     $player->town_id = $request->get('town', towns(true)->first()->id());
     $player->world_id = $request->get('world', worlds()->first()->id());
     $player->sex = $request->get('sex', genders()->first()->id());
     $player->conditions = '';
     $player->save();
     event(new Created($player, $this->account));
     return $player;
 }
Exemplo n.º 9
0
 /**
  * Execute the job.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return string|null
  */
 public function handle(Request $request)
 {
     $key = $this->account->generateRecoveryKey();
     $registration = app('account.registration');
     $registration->account_id = $this->account->id();
     $registration->firstname = $request->old('firstname');
     $registration->surname = $request->old('surname');
     $registration->country = $request->old('country');
     $registration->gender = $request->old('gender');
     $registration->birthday = $this->birthday($request);
     $registration->save();
     event(new Created($this->account));
     return $key;
 }
Exemplo n.º 10
0
 /**
  * Execute the job.
  *
  * @return \Apolune\Contracts\Account\Account|null
  */
 public function handle()
 {
     $this->account->load('registration');
     $firstname = $this->account->registration->requestFirstname();
     $surname = $this->account->registration->requestSurname();
     $country = $this->account->registration->requestCountryCode();
     $this->account->registration->firstname = $firstname;
     $this->account->registration->surname = $surname;
     $this->account->registration->country = $country;
     $this->account->registration->request_date = null;
     $this->account->registration->request_firstname = null;
     $this->account->registration->request_surname = null;
     $this->account->registration->request_country = null;
     $this->account->registration->save();
     event(new Accepted($this->account));
     return $this->account;
 }