Thanks for looking here.
I have a problem with integrating Strava with http://documentup.com/basvandorst/StravaPHP I am following every step but it looks like it returns A Null as a result.
In my model I have:
$this->oauth = new OAuth([ 'clientId' => config('strava.client_id'), 'clientSecret' => config('strava.client_secret'), 'redirectUri' => config('strava.redirect_url') ]);
For getting the Strata login link I have:
Then I am saving the returned information in the database:
$token = $this->oauth->getAccessToken('authorization_code', array( 'code' => $request->code )); $attributes = [ 'user_id' => auth()->user()->id, 'strava_id' => $token->jsonSerialize()['athlete']['id'], 'strava_token' => $token->getToken(), 'strava_user_expires_date' => $token->getExpires() ];
So the request to Strava was successful and I do have the strava_user_token and the strava_user_id
So far so good.
The problem comes when I try to get the athlete:
$adapter = new Pest('https://www.strava.com/api/v3'); $service = new REST(strava_data['strava_token'], $adapter); $client = new Client($service); $athlete = $client->getAthlete(); dd($athlete); //returns null
No matter I try to get from $client (->getAthlete(), ->getAthleteActivities, ->getClub()) it always returns null.
Any help will be much appreciated. Thanks again for looking at this and spending your time helping.