1. Go to this page and download the library: Download peal/laravel-social-login library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
peal / laravel-social-login example snippets
$ php artisan vendor:publish
Which provider or tag's files would you like to publish?:
[0 ] Publish files from all providers and tags listed below
[1 ] Provider: Facade\Ignition\IgnitionServiceProvider
[2 ] Provider: Fideloper\Proxy\TrustedProxyServiceProvider
[3 ] Provider: Illuminate\Foundation\Providers\FoundationServiceProvider
[4 ] Provider: Illuminate\Mail\MailServiceProvider
[5 ] Provider: Illuminate\Notifications\NotificationServiceProvider
[6 ] Provider: Illuminate\Pagination\PaginationServiceProvider
[7 ] Provider: Laravel\Tinker\TinkerServiceProvider
[8 ] Provider: peal\socialLogin\LoginServiceProvider
[9 ] Tag: flare-config
[10] Tag: ignition-config
[11] Tag: laravel-errors
[12] Tag: laravel-mail
[13] Tag: laravel-notifications
[14] Tag: laravel-pagination
> 8
Route::get('gitauthorize', function(){
GithubLogin::getClientId();
GithubLogin::getRedirectUri();
return GithubLogin::getAuthorizeURL();
});
Route::get('gitloginsuccess', function(Request $request){
$access_token = GithubLogin::getAccessToken($request);
//Save this information into your database user table
return GithubLogin::gitHubApiCall($access_token);
});
Route::get('facebookLogin', function(){
FacebookLogin::getCallBackUrl();
FacebookLogin::getScope();
$login_url = FacebookLogin::getLoginUrl();
return redirect($login_url);
});
Route::get('facebook-success', function(){
//Save this information into your database user table
return FacebookLogin::getOAuth2Client();
});
Route::get('googleLogin', function(){
GoogleLogin::getScopes();
return GoogleLogin::gotoAuthUrl();
});
Route::get('google-success', function(Request $request){
if ($request->has('code') && empty($request->get('state'))) {
//return GoogleLogin::getAccessToken(trim($request->get('code')));
//Save this information into your database user table
return $userinfo = GoogleLogin::clientLogin(trim($request->get('code')));
}
});
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.