0

I have followed the instructions for implementing the Strava Socialite provider on a fresh Laravel 5.5. install: http://socialiteproviders.github.io/providers/strava/

The only change I've made is to wrap the array key in a string in App/Providers/EventServiceProvider.php as below as it complained about unknown constant otherwise:

protected $listen = [
    'App\Events\Event' => [
        'App\Listeners\EventListener',
    ],
    '\SocialiteProviders\Manager\SocialiteWasCalled' => [
        'SocialiteProviders\Strava\StravaExtendSocialite@handle'
    ]
];

The error I get is:

InvalidArgumentException
Driver [strava] not supported.

Is there a known issue with 5.5 or is it obvious I've missed a step?

David
  • 320
  • 1
  • 6
  • 22
  • Although my answer will resolve your question, "it complained about unknown constant" is a little concerning — what version of PHP are you using? This may be indicative of further problems to come. – sam Jan 17 '18 at 23:50
  • Thanks, your answer worked perfectly @sam I am using 7.2. I did find it odd as all examples for other providers are the same – David Jan 18 '18 at 09:03

1 Answers1

0

If you're providing the class as a string then you should do so without the global namespace reference (\):

protected $listen = [
    'SocialiteProviders\Manager\SocialiteWasCalled' => [
        'SocialiteProviders\Strava\StravaExtendSocialite@handle',
    ],
];
sam
  • 5,459
  • 6
  • 32
  • 53