public function postGamertagOwnership(OwnershipFormRequest $request) { $account = Account::where('seo', Text::seoGamertag($request->request->get('gamertag')))->first(); $this->user->account_id = $account->id; $this->user->save(); return \Redirect::action('UserCpController@getIndex')->with('flash_message', ['header' => 'Gamertag Verified!', 'close' => true, 'body' => 'You have proved ownership of <strong>' . $account->gamertag . '</strong>.']); }
public static function getAccountIdViaDestiny($membershipId) { $account = Account::where('destiny_membershipId', $membershipId)->first(); if ($account instanceof Account) { return $account->id; } return null; }
/** * @param $gamertag * @return \Onyx\Account|void */ private function checkCacheForGamertag($gamertag) { $account = Account::where('seo', DestinyText::seoGamertag($gamertag))->first(); if ($account instanceof Account) { return $account; } return false; }
/** * @param $gamertag * @return mixed */ private function getAccount($gamertag) { $lowercase = Text::seoGamertag($gamertag); return Account::where('seo', $lowercase)->first(); }
public function findAccountViaMembershipId($membershipId, $returnAccount = true) { foreach ($this->players as $player) { if ($player->membershipId == $membershipId) { if ($returnAccount == false) { return $player; } else { return $player->account; } } } return \Onyx\Account::where('destiny_membershipId', $membershipId)->first(); }