示例#1
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;
 }
示例#2
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;
 }