public function fetchAccountsPresence($accounts) { $client = new GuzzleClient(['base_uri' => XboxConstants::$getBaseXboxAPI]); // Set up getCommands $requests = array(); foreach ($accounts as $account) { if ($account->xuid == null) { $destiny = new DestinyClient(); $account = $destiny->fetchAccountData($account); } $url = sprintf(XboxConstants::$getPresenceUrl, $account->xuid); $requests[$account->seo] = $client->getAsync($url, ['headers' => ['X-AUTH' => env('XBOXAPI_KEY')]]); } $results = GuzzlePromise\Unwrap($requests); return $results; }
/** * Execute the command. * * @return void */ public function handle() { $client = new Client(); $account = $client->fetchAccountByGamertag($this->type, $this->gamertag); $client->fetchAccountData($account); }
/** * Execute the command. * * @return void */ public function handle() { $client = new Client(); $client->fetchAccountData($this->account); }