PHP code example of blaspsoft / socialiteplus
1. Go to this page and download the library: Download blaspsoft/socialiteplus 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/ */
blaspsoft / socialiteplus example snippets
use App\Http\Middleware\HandleSocialitePlusProviders;
Route::get('register', [RegisteredUserController::class, 'create'])
->middleware(HandleSocialitePlusProviders::class)
->name('register');
Route::get('login', [AuthenticatedSessionController::class, 'create'])
->middleware(HandleSocialitePlusProviders::class)
->name('login');
return [
'button_text' => '{provider}',
'providers' => [
'google' => [
'active' => true,
'branded' => false,
'name' => 'Google',
'icon' => 'GoogleIcon',
'client_id' => env('GOOGLE_CLIENT_ID'),
'client_secret' => env('GOOGLE_CLIENT_SECRET'),
'redirect' => env('GOOGLE_REDIRECT'),
],
'facebook' => [
'active' => true,
'branded' => false,
'name' => 'Facebook',
'icon' => 'FacebookIcon',
'client_id' => env('FACEBOOK_CLIENT_ID'),
'client_secret' => env('FACEBOOK_CLIENT_SECRET'),
'redirect' => env('FACEBOOK_REDIRECT'),
],
'github' => [
'active' => true,
'branded' => false,
'name' => 'GitHub',
'icon' => 'GithubIcon',
'client_id' => env('GITHUB_CLIENT_ID'),
'client_secret' => env('GITHUB_CLIENT_SECRET'),
'redirect' => env('GITHUB_REDIRECT'),
],
'linkedin' => [
'active' => true,
'branded' => false,
'name' => 'LinkedIn',
'icon' => 'LinkedInIcon',
'client_id' => env('LINKEDIN_CLIENT_ID'),
'client_secret' => env('LINKEDIN_CLIENT_SECRET'),
'redirect' => env('LINKEDIN_REDIRECT'),
],
],
];
public function create(Request $request): Response
{
// React
return Inertia::render('auth/login-social', [
'canResetPassword' => Route::has('password.request'),
'status' => $request->session()->get('status'),
'providersConfig' => $request->attributes->get('providersConfig'),
]);
// Vue
return Inertia::render('auth/LoginSocial', [
'canResetPassword' => Route::has('password.request'),
'status' => $request->session()->get('status'),
'providersConfig' => $request->attributes->get('providersConfig'),
]);
}
public function create(Request $request): Response
{
// React
return Inertia::render('auth/register-social', [
'providersConfig' => $request->attributes->get('providersConfig'),
]);
// Vue
return Inertia::render('auth/RegisterSocial', [
'providersConfig' => $request->attributes->get('providersConfig'),
]);
}
bash
php artisan socialiteplus:install vue
bash
php artisan socialiteplus:install react
bash
php artisan vendor:publish --tag=socialiteplus-config
bash
php artisan config:cache
bash
php artisan test