示例#1
0
 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>.']);
 }
示例#2
0
 public static function getAccountIdViaDestiny($membershipId)
 {
     $account = Account::where('destiny_membershipId', $membershipId)->first();
     if ($account instanceof Account) {
         return $account->id;
     }
     return null;
 }
示例#3
0
 /**
  * @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;
 }
示例#4
0
 /**
  * @param $gamertag
  * @return mixed
  */
 private function getAccount($gamertag)
 {
     $lowercase = Text::seoGamertag($gamertag);
     return Account::where('seo', $lowercase)->first();
 }
示例#5
0
 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();
 }