phhung1901 / google_one_tap
Login with google one tap/google popup login
Installs: 7 022
Dependents: 0
Suggesters: 0
Security: 0
Stars: 14
Watchers: 3
Forks: 2
Open Issues: 1
Type:php
Requires
- php: >=8.1
- google/apiclient: ^2.0@dev
- laravel/framework: ^9.0 || ^10.0 || ^11.0
- laravel/socialite: ~5.0
This package is auto-updated.
Last update: 2025-04-08 18:25:23 UTC
README
google-one-tap
Login with google one tap/google popup login for Laravel
Installation
requires
- php: >=8.1
- laravel/framework: ^9.0 || ^10.0 || ^11.0
composer require phhung1901/google_one_tap
Config
Add configuration to config/services.php
'google' => [ 'client_id' => env('GOOGLE_CLIENT_ID'), 'client_secret' => env('GOOGLE_CLIENT_SECRET'), 'redirect' => env('GOOGLE_URL') ],
Usage
1. Added to scripts
<script src="https://accounts.google.com/gsi/client" async="" defer=""></script>
2. Next, you must publish the component
Add to providers
config/app.php
\GoogleOneTap\Services\GoogleOneTapServiceProvider::class,
php artisan vendor:publish --tag=google_one_tap
Now, add the component wherever you want google_one_tap to be used.
<x-google_one_tap.onload/>
Config googe-one-tap.php
you can add customizations
3. Returned User fields
$token = GoogleOneTapService::getToken($request); return Socialite::driver('google-one-tap')->stateless()->userFromToken($token)
License
The MIT License (MIT). Please see License File for more information.