I have a laravel project that uses Socialite to handle OAuth for google drive. Unfortunately I’m in an odd situation where I need to support two different google cloud credentials depending on the user. This is far from ideal, but there is currently no way around this.
I have tried creating a copy of the Google driver in AppServiceProvider.php but still run into the error “Driver [new_google] not supported”:
// in boot function of AppServiceProvider.php
$this->app->singleton("LaravelSocialiteContractsFactory", function ($app) {
$factory = new LaravelSocialiteSocialiteManager($app);
$factory->extend(
"new_google",
function ($app) use ($factory) {
$config = $app["config"]["services.new_google"];
return $factory->buildProvider(
"LaravelSocialiteTwoGoogleProvider",
$config,
);
},
);
return $factory;
});
Thank you for any help!