Last active
January 12, 2024 03:25
-
-
Save afiqiqmal/e65451c1eb0c4121fd3f07e305de21c2 to your computer and use it in GitHub Desktop.
Example usage of Socialite with one Controller in Laravel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return = [ | |
'google' => [ | |
'client_id' => env('GOOGLE_CLIENT_ID'), | |
'client_secret' => env('GOOGLE_CLIENT_SECRET'), | |
'redirect' => env('GOOGLE_CALLBACK_URL'), | |
], | |
'facebook' => [ | |
'client_id' => env('FACEBOOK_CLIENT_ID'), | |
'client_secret' => env('FACEBOOK_CLIENT_SECRET'), | |
'redirect' => env('FACEBOOK_CALLBACK_URL'), | |
], | |
'github' => [ | |
'client_id' => env('GITHUB_CLIENT_ID'), | |
'client_secret' => env('GITHUB_CLIENT_SECRET'), | |
'redirect' => env('GITHUB_CALLBACK_URL'), | |
], | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Route::prefix('auth')->group(function () { | |
Route::get('provider/{provider}', 'SocialController@redirectToProvider')->name('social.login'); | |
Route::get('provider/{provider}/callback', 'SocialController@handleProviderCallback'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
great, but you missed the
config
and.env
files example.