- What is kainxspirits/laravel-pubsub-queue used for?
- It is a Laravel queue driver for Google Cloud Pub/Sub. You add a pubsub connection in config/queue.php and dispatch jobs through Pub/Sub instead of a database or Redis queue. It fits event-driven and fan-out workloads supported by Pub/Sub.
- How do I install and configure the Laravel PubSub queue driver?
- Install it with composer require kainxspirits/laravel-pubsub-queue. If package discovery is disabled, register Kainxspirits\PubSubQueue\PubSubQueueServiceProvider in config/app.php. Add a pubsub connection to config/queue.php with driver pubsub, project_id, queue, retries, request_timeout, subscriber, create_topics, and create_subscriptions as needed. Use snake_case keys matching Google Cloud PubSub client options.
- Which Laravel versions does laravel-pubsub-queue support?
- Version 0.11.0 extends support to Laravel 13, following earlier support for Laravel 10, 11, and 12. The package's illuminate/* constraints admit Laravel 13 according to the release notes. Verify with composer why-not before making a roadmap commitment. Support for older majors may be dropped in a future release, so pin versions and test upgrades.
- How do I run the package tests locally?
- Run vendor/bin/phpunit after installing dependencies. CI runs tests on PHP 8.4 and 8.5 per the 0.11.0 notes. Green CI does not replace staging validation of your real job payloads, dispatch, queue:work, failure, and retry paths.
- What configuration options are available for the pubsub queue connection?
- The connection accepts driver, queue, queue_prefix, project_id, retries, request_timeout, subscriber, create_topics, and create_subscriptions. You can use any configuration values from the original Pub/Sub client as long as keys are snake_case. Set create_topics and create_subscriptions to false to avoid Pub/Sub administrator operations limits. Check the Google Cloud PubSub client docs for constructor options.
- How do retries and timeouts work with this Pub/Sub queue driver?
- Configure retries and request_timeout in the pubsub connection array. Retries controls job attempts, while request_timeout sets the Pub/Sub client request timeout in seconds. Validate failure and retry behavior in staging because Laravel queue internals can differ across major versions.
- Should I enable create_topics and create_subscriptions in production?
- The README recommends changing both flags to false to avoid administrator operations limits. Enable them only when bootstrapping topics and subscriptions in non-production or controlled environments. In production, provision topics and subscriptions ahead of time and let the driver publish and consume without admin calls.
- Does this package support Laravel 13 and PHP 8.4 or 8.5?
- Version 0.11.0 adds Laravel 13 compatibility through PR #88 and runs the test suite on PHP 8.4 and 8.5 via PR #89. Confirm whether PHP 8.5 is a required or allowed-to-fail CI job; do not treat it as a support commitment unless the maintainer confirms. Check composer resolution in a Laravel 13 skeleton with your google/cloud-pubsub pin.
- Is kainxspirits/laravel-pubsub-queue safe to use in production?
- It is a viable Laravel queue driver, but at 0.x semver a minor bump may contain breaking changes. Pin exact versions and upgrade through a reviewable PR. Validate dispatch, queue:work, failure and retry paths, and queue:failed integration in staging. The google/cloud-pubsub dependency remains the dominant external risk.
- What are alternatives to using Google Pub/Sub as a Laravel queue driver?
- Laravel supports built-in drivers such as database, Redis, SQS, and Beanstalkd, and other community packages may target Pub/Sub. Choose Pub/Sub when you need event-driven fan-out or event-sourcing support. Compare operational overhead and dependency risk with your existing cloud stack.