Setup Routes that point to your login controller:
Route::group([
'prefix' => 'oauth',
], function () {
Route::match(['get', 'post'], '{provider}', 'LoginController@redirectToProvider')->name('oauth.redirect');
Route::match(['get', 'post'], '{provider}/callback', 'LoginController@handleProviderCallback')->name('oauth.callback');
});
Add to the config/services.php file an entry for each of the specific providers
'{provider}' => [
'client_id' => 'the_client_id',
'client_secret' => 'the_client_secret',
'redirect' => 'https://application.app/oauth2/{provider}/callback',
],
Publish the config and add an entry for the allowed provider_name
return [
'providers' => [
'allowed' => [
'{provider}',
],
]
];