Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Apiclient Services

Apiclient Services Laravel Package

google/apiclient-services

Auto-generated Google API service definitions for the Google API PHP Client. Updated daily to reflect new/changed APIs and tagged weekly. Install via Composer (typically as a dependency of google/apiclient) to access specific Google service classes.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Apiclient Services
How do I integrate Google API services (e.g., Drive, Gmail) into a Laravel application?
Install the package via Composer (`google/apiclient-services`), then register the Google API client in Laravel’s service container. Inject `Google_Service_*` classes (e.g., `Google_Service_Drive`) into controllers or services. Use Laravel’s facades or service providers to abstract initialization, like `GoogleDrive::upload()` for cleaner syntax.
Which Laravel versions are supported by google/apiclient-services?
The package itself has no Laravel-specific dependencies, so it works with Laravel 8.x, 9.x, and 10.x. Ensure your project uses PHP 8.0+ and the required `google/apiclient` (v2.0+). Test thoroughly with your Laravel version, as some OAuth or dependency injection patterns may need minor adjustments.
Can I use this package for OAuth 2.0 authentication in Laravel?
Yes, the package includes built-in OAuth 2.0 support. Use Laravel’s Sanctum or Passport to manage tokens, then integrate the Google client’s OAuth flow. Store refresh tokens in Laravel’s cache or database, and implement token refresh logic in a custom service class for seamless authentication.
How do I handle API rate limits or large-scale operations (e.g., processing 50K+ files) in Laravel?
Leverage Laravel’s queues and jobs to process batch operations. Use the Google API’s pagination (`pageToken`) and implement exponential backoff for rate-limited requests. For example, dispatch a `SyncDriveFilesJob` to handle chunks of files asynchronously, monitored via Laravel Horizon or Statsd.
Are there Laravel-specific enhancements or wrappers for this package?
Yes, you can create Laravel-specific wrappers like service providers, facades (e.g., `GoogleDrive::upload()`), or even a custom filesystem adapter (e.g., `GoogleDriveDisk`) to integrate with Laravel’s `Storage` facade. This bridges Google APIs to Laravel’s native patterns for consistency.
How do I mock Google API responses for testing in Laravel?
Use tools like VCR or Mockery to mock API responses in unit/integration tests. Laravel’s HTTP testing helpers can simulate OAuth flows. For example, record a Gmail API response with VCR, then replay it in tests without hitting Google’s servers, ensuring predictable and fast test execution.
What’s the best way to handle errors from Google_Service_Exception in Laravel?
Map `Google_Service_Exception` to Laravel’s `HttpException` or `Reportable` interface in a custom exception handler. Use Laravel’s error handling middleware to log errors consistently and surface user-friendly messages. For example, catch exceptions in a controller and return a `response()->json()` with a standardized error format.
Does this package support real-time updates (e.g., Google Calendar events) in Laravel?
For near-real-time updates, implement polling-based workflows with Laravel queues. For example, create a `CalendarChangeDetector` job that periodically checks for changes and dispatches events or notifications. Use Laravel Echo or Pusher for push-based updates if needed, though polling is simpler to integrate.
How often are the Google API service definitions updated, and how do I stay compliant?
The package auto-updates daily with new API changes and is tagged weekly. Monitor Google’s API changelog for deprecations and implement CI/CD checks (e.g., `composer validate`) to catch compatibility issues early. Use semantic versioning for Laravel-specific wrappers and feature flags for deprecated endpoints.
Are there alternatives to google/apiclient-services for Laravel, and when should I consider them?
Alternatives include manually using the base `google/apiclient` or third-party wrappers like `spatie/google-drive-api`. Use `google/apiclient-services` for official, auto-generated clients covering multiple APIs (Drive, Gmail, etc.). Choose alternatives only if you need lightweight, single-API solutions or custom implementations not covered by Google’s official clients.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codraw/graphviz
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata