SocialiteProviders: Google

Google OAuth2 provider for Laravel Socialite, part of the community SocialiteProviders collection

Library
Composer
v4.1.0
575stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
73/100Good
Development Activity84
Maintenance44
Community84
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
75/100Good
Architecture78
Code Quality76
Innovation62
Learning Curve82

socialiteproviders/google is the Google OAuth2 provider for Laravel Socialite, distributed as one package within the community-maintained SocialiteProviders/Providers monorepo — a single repository housing OAuth1/OAuth2 provider implementations for dozens of services, individually installable via Composer.

It plugs into Socialite’s SocialiteWasCalled event system to register a google driver, letting a Laravel app authenticate users via Google without maintaining custom OAuth2 handshake code. It returns a normalized user object (id, nickname, name, email, avatar) consistent with Socialite’s other drivers.

What You Get

  • A ready-to-use google Socialite driver requiring only client ID/secret/redirect config
  • A normalized OAuth2 user object (id, nickname, name, email, avatar)
  • Event-based registration (SocialiteWasCalled) matching Laravel 10/11+ conventions
  • Shared reliance on socialiteproviders/manager for consistent provider boilerplate across all SocialiteProviders packages

Common Use Cases

  • Adding ‘Sign in with Google’ to a Laravel application without hand-rolling OAuth2
  • Consolidating multiple social login providers (Google, GitHub, Microsoft, etc.) under one consistent Socialite-based API
  • Migrating from a deprecated per-service provider package (e.g. the old Google+ provider) to the actively maintained Google provider

Under The Hood

Architecture - The Google provider lives at src/Google/ inside the SocialiteProviders/Providers monorepo, consisting of a Provider.php (extends Socialite’s abstract OAuth2 provider with Google’s authorize/token/user-info endpoints) and a GoogleExtendSocialite.php listener that registers the driver when Laravel dispatches SocialiteWasCalled. This mirrors the structure of the other 270+ provider directories in the same repo, all sharing the top-level socialiteproviders/manager dependency for event wiring and base provider behavior. Tech Stack - PHP 8.0+ (repo-wide toolchain targets PHP 8.5), built on socialiteproviders/manager ^4.4 and, at the monorepo root, league/oauth1-client for the OAuth1-based sibling providers; dev tooling includes Laravel Pint and php-parallel-lint, run repo-wide via GitHub Actions. Code Quality - Individual provider directories are small (a provider class plus an extend-listener) and rely on the shared manager package’s tested OAuth2 base class rather than duplicating request/token-exchange logic; the monorepo’s per-package composer.json split lets each of the 270+ providers be required independently while sharing one CI/lint configuration. API Design - Usage is a two-step pattern common to every SocialiteProviders package: register the event listener once, then call Socialite::driver('google')->redirect() as if it were a Laravel built-in driver, keeping the API surface identical across all supported OAuth providers and minimizing the learning curve for teams already using Socialite.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search