tomshaw/google-api
A Google OAuth 2.0 service client for Laravel that handles authentication, configurable token storage (including database), and scoped access to Google APIs such as Gmail and Calendar. Ships with a publishable config file and a customizable token storage adapter.
Verdict: Conditional go for a time-boxed pilot; not a platform bet. This is a thin, opinionated Laravel wrapper around google/apiclient. The technical risk lives almost entirely in the wrapper's version pinning and maintenance, not in the Google SDK underneath.
Architecture fit
GoogleClient), token persistence (StorageAdapterInterface), and service ergonomics (adapters + facade) are separated cleanly, which gives us identifiable extension points.forUser() plus UserScopedStorageAdapter is the highest-value capability for our use case — it makes queued jobs and console commands able to act on a user's Google account without an authenticated request context. That is usually the messiest part of a Google integration.GoogleApi::service(Sheets::class) is a genuine escape hatch: any of the ~200 Google APIs is reachable without waiting for the package to ship an adapter. This materially reduces lock-in.Integration feasibility
composer require + vendor:publish + migrate. Low ceremony.google/apiclient-services cleanup script and allowlist must be added to the consuming app's composer.json. Easy to miss, and it has real artifact-size and CI-cache consequences.Technical risk
php ^8.5 and laravel ^13.0 are bleeding-edge constraints. If the fleet is on 8.3/8.4 and Laravel 11/12, this package is not installable at all without an upgrade program. It signals good forward hygiene but drastically narrows the addressable install base.google/apiclient and google/apiclient-services (large but generally well-maintained) plus this wrapper. The wrapper is the thin, unpinned link.Key questions
google_tokens schema meet our tenant-isolation and retention requirements, or do we implement a custom adapter from day one?Stack fit
Migration path
google/apiclient: the wrapper does not hide the SDK, so migration is incremental — adopt GoogleClient plus token storage first, keep existing SDK call sites, then move call sites adapter by adapter. GoogleApi::service() means no call site is blocked on package support.StorageAdapterInterface (and UserScopedStorageAdapter for forUser()). This is the cleanest adoption path — the package becomes our auth/transport layer only, which is the lowest-risk way to consume it.Compatibility
^8.5 / ^13.0 constraints are hard gates. Run composer why-not before planning anything further.google/apiclient-services cleanup script interacts with CI caching and deploy artifact size; validate in a staging build, not locally.Sequencing
GoogleClient, choose DB adapter vs. custom adapter, settle key management, and centralize TokenNotFoundException → redirect handling in one middleware or exception handler.forUser() — this is where most of the value is; explicitly validate token refresh inside queue workers.Maintenance
google_tokens, consent-screen upkeep (Google's verification and scope-change review is slow and recurring), and any Google API deprecation response.Support
TokenNotFoundException carrying the auth URL), a readonly AccessToken value object with isExpired() / hasRefreshToken(), and the underlying SDK error surface still reachable.Scaling
forUser() in queue workers scales horizontally without auth context, which is the right architectural shape.Failure modes
TokenNotFoundException in a queue context where no redirect is possible — must be caught and converted into a failed job with a reason, never an unhandled exception.extra.google/apiclient-services fails at runtime with class-not-found, which is a non-obvious diagnosis.access_type: Offline and include_grant_scopes is the classic cause of "we never got a refresh token" incidents.Ramp-up
How can I help you explore Laravel packages today?