google/cloud-tasks
Official Google Cloud Tasks client library for PHP. Create and manage queues, dispatch asynchronous HTTP and App Engine tasks, configure retries and scheduling, and integrate with Google Cloud IAM and authentication through the Google Cloud PHP SDK.
Architecture fit — This is a generated GAPIC client for Google Cloud Tasks, not a Laravel package. There is no service provider, no publishable config, no facade, and no queue driver. Architecturally, Cloud Tasks is a push model: you enqueue an HTTP request with a payload, and Google delivers it to a target URL under a retry/rate policy. Laravel's queue contract is pull (pop/reserve/delete), so this does not slot into config/queue.php as a driver. The realistic fit is twofold:
maxDispatchesPerSecond, maxConcurrentDispatches, and maxBurstSize are queue-level controls that are materially better than what Laravel workers give you against a fragile upstream API.Integration feasibility — Feasible but requires a deliberate adapter. Costs to budget:
google/auth, but env/secret handling is yours.ext-grpc) or REST fallback. REST is the low-friction path for standard PHP-FPM/Cloud Run images; gRPC needs a build-time extension.Technical risk
ShouldBeUnique on Redis does not cover the Cloud Tasks → endpoint hop.googleapis/google-cloud-php). Do not read this as abandonment; conversely, do not read the automated release cadence as Laravel-specific support. Both the stars and the release date should be discounted as adoption evidence.Key questions — Where does the Laravel app actually run, and is it reachable by Google over public HTTPS? Is ext-grpc viable in our image, or do we standardize on REST? Who owns idempotency keys and the dead-letter/replay path? Are we already running Horizon/Redis, and are we willing to split async concerns across two systems? Which workload goes first — scheduled reminders or rate-limited third-party egress? What is our service-account-per-environment model?
Stack fit — Treat Cloud Tasks as infrastructure adjacent to Laravel, not inside it. Build a thin CloudTasksDispatcher interface (~200–400 LOC) with: enqueue(string $handler, array $payload, ?DateTimeInterface $scheduleAt, array $headers), a queue-name map per environment, and a FakeDispatcher for tests. Bind it in a service provider; keep the generated client behind it so a future swap to SQS or EventBridge is a single implementation change. On the receiving side, one signed, idempotent controller endpoint that validates the task header/OIDC token, records the attempt, and dispatches a conventional Laravel job.
Migration path — Do not attempt to replace the existing queue driver. Coexist: keep database/Redis + Horizon for CPU-bound and transactional work; route only genuinely scheduled or externally-paced work to Cloud Tasks. Migrate one workflow at a time, behind a config flag, with the old path retained for a release cycle so you can dual-run and compare.
Compatibility — Pin the package to a minor version, run composer update --dry-run in CI, and require ext-grpc or ext-json+REST explicitly in composer.json. Support matrix should cover PHP 8.2+ and the Laravel versions in use; there is no framework coupling to break, which is the package's main compatibility virtue.
Sequencing — (1) Stand up the dispatcher abstraction + fake and land it with no callers. (2) Prove the network path and auth in staging with a no-op handler. (3) Migrate one low-blast-radius workflow (e.g., outbound webhooks). (4) Harden idempotency, dead-letter logging, and alerting. (5) Add rate-limited egress. (6) Only then consider scheduled reminders or anything user-facing. Rough order of magnitude: one to two sprints for the first production slice including the observability work.
Maintenance — Low ongoing code maintenance: releases are automated from the upstream monorepo, Apache-2.0, no transitive framework dependencies. The maintenance burden is not the library — it is the idempotency, dead-letter, and replay machinery you must own. Budget recurring time for dependency bumps and for GCP-side queue configuration drift (retry policy and rate limits changed by hand in console).
Support — Split ownership is the risk. Google Cloud Support covers the Cloud Tasks service; the PHP library is GitHub issues from a generated-code team with no Laravel context. Internal escalation should route to the platform/cloud team, not the framework team. Ramp-up for a mid-level Laravel engineer is real: IAM/service accounts, queue semantics, push-vs-pull mental model, and scheduleTime/retention constraints — call it one to two weeks to productive, not days.
Scaling — Strong. Queue-level throttles protect upstreams better than anything native to Laravel; tasks can be scheduled up to ~30 days out with 31-day retention. Throughput ceilings are quota-bound, not library-bound, and are raised via GCP quota requests. The main scaling hazard is recovery behavior: if the handler is down, tasks accumulate and then arrive in a burst — maxDispatchesPerSecond is your thundering-herd control, so set it deliberately rather than leaving defaults.
Failure modes to instrument from day one:
maxAttempts the task is dropped with no DLQ. Alert on tasks reaching high attempt counts and on attemptDispatchCount distributions.Ramp-up — Plan for a short internal design doc and one brown-bag session covering the push model, idempotency expectations, and the "no DLQ" reality. That single hour is the difference between a clean adoption and a quarter of duplicate-email incidents.
How can I help you explore Laravel packages today?