illuminate/queue
Illuminate Queue is Laravel’s queue component, offering a unified API for multiple backends to run time‑consuming jobs asynchronously. Use the Capsule manager to configure connections outside Laravel and push jobs via instance or static access.
Start by installing illuminate/queue via Composer (composer require illuminate/queue) and initializing a Capsule manager to configure your queue connections. The Capsule API mirrors Laravel’s global service container, making it easy to use outside Laravel apps. Define your first connection (e.g., beanstalkd, redis, or database) in the addConnection() call, then use $queue->push(JobClass, $data) or Queue::push(...) if set as global. The simplest first use case is dispatching a basic job (e.g., a mailable handler) to offload slow tasks from HTTP requests. Check the Laravel docs for the full suite of supported drivers and configuration options.
ShouldQueue interface and handle() method on your job classes; use Queue::push() or dispatch() (via Queue::pushOn()/pushRaw() for advanced control).Bus::batch([...])->dispatch() or Bus::chain([...])->dispatch() for grouped or sequential jobs (requires illuminate/bus).addConnection('alias', $config) to register named connections, then Queue::connection('alias') for multi-queue setups (e.g., high, low priority).php artisan queue:work (if in a Laravel app) or manually run Queue::pop('connection')->process($job) in CLI workers.Queue::failing(...)).database driver requires a jobs table schema (php artisan queue:table && php artisan migrate); redis needs Predis or phpredis; sqs requires AWS credentials.retry_after in config to prevent jobs from hanging (e.g., 60 for beanstalkd), and use public $tries = 3 on job classes.Queue::fake() in tests to assert dispatched jobs without running workers.Queue::before(), Queue::after(), Queue::looping(), and Queue::afterFailingJob() (Laravel 8+).laravel/framework; prefer installing laravel/framework if you’re in a full Laravel app.How can I help you explore Laravel packages today?