The shared foundation for every ArtisanPack UI Google integration. One OAuth2 authorization-code and PKCE flow, encrypted per-user token storage with transparent refresh, a scope registry so a single consent screen covers every installed service, and credential drivers for config, database or the CMS Settings module.
v1.3.0
MIT License
★ 0
composer require artisanpack-ui/google
$ composer require artisanpack-ui/google
✓ Provider and Google facade auto-discovered
$ php artisan migrate
✓ google_configurations, google_connections
/google/auth/connect → one consent screen
What it does
One connection, every Google service
Service packages declare the scopes they need and ask for a valid access token. They never touch OAuth, refresh logic or credential storage — the base owns all of it.
OAuth2 with PKCE
Builds the consent URL, exchanges the callback code and reads the user's identity from the returned id_token.
Encrypted token storage
Per-user google_connections rows with transparent refresh 60 seconds before expiry — and auto-disconnect on invalid_grant.
Shared scope registry
Service packages add scopes through the ap.google.scopes filter. Consent covers the de-duplicated union, so users see one screen.
Credential drivers
Keep credentials in config, in the encrypted google_configurations table, or in the CMS framework's Settings module.
Incremental consent
Add a service package later and the reauthorize route asks Google only for the missing scopes, merging with the existing grant.
Connection UI, three ways
Interchangeable Livewire, React and Vue connection managers — connect, disconnect, status — all backed by the same JSON endpoint.
Built on the base
The Google integrations
Each service package contributes its own scopes to the shared registry and pulls tokens from the base. Install as many as you need — users still see one consent screen.
v1.1.0
Analytics Google
GA4 tracking snippet plus server-side Data API reporting components.
View package
v1.0.0
Google Search Console
Performance cards, top queries and top pages from your verified property.
View package
v1.0.0
Google Tag Manager
Container snippet installer plus container and tag admin components.
View package
Get started
Install and connect
Create an OAuth client in the Google Cloud Console, point it at /google/auth/callback, then send users to route('google.auth.connect').
1 · Install
composer require artisanpack-ui/google
2 · Publish migrations
php artisan vendor:publish --tag=google-migrations
3 · Run migrations
php artisan migrate
4 · Publish config (optional)
php artisan vendor:publish --tag=google-config
Requirements
What you need
| Requirement | Detail |
|---|---|
| Laravel | 10, 11, 12 or 13 |
| Google Cloud | An OAuth client ID and secret with your callback as an authorized redirect URI |
| Connection UI | livewire/livewire ^3.6 (optional) — React and Vue ship as source |
| CMS driver | artisanpack-ui/cms-framework (optional) |
| Neither Livewire nor the CMS framework is required — the base boots and works without them. The config driver is read-only; use the database or cms driver when credentials are managed from an admin UI. | |
Wire up Google with one package
OAuth2, encrypted tokens, transparent refresh and single-consent scope management. Free and open source under the MIT license.
