stancl/jobpipeline
Convert an event into a sequence of jobs. JobPipeline turns any series of Laravel jobs into an event listener, letting you send data from the event and run the pipeline sync or queued, optionally on a specific queue.
CreateDatabase → MigrateDatabase → SeedDatabase).return false) ensures idempotency for critical workflows (e.g., tenant provisioning).EventServiceProvider or Event::listen(), with no database migrations or schema changes.try-catch blocks.config('queue.fail_on_timeout')).spatie/laravel-queue-supervisor).Job B reading Job A’s output without explicit event dispatching). Workaround:
DatabaseCreated → MigrateDatabaseJob).fake() for events/queues.batch() in Laravel 10+).JobPipeline::$shouldBeQueuedByDefault = true).JobPipeline patterns.Illuminate\Broadcasting).Event::listen(fn() => MyJob::dispatch())).JobPipeline (e.g., TenantCreated → [CreateDB, MigrateDB, SeedDB]).CreateDB job).MyJob::dispatch()).JobPipeline::toListener() for clean listener registration.Retry, Timeout).handle() with dependencies).spatie/laravel-activitylog, laravel-breeze, etc.JobA emits JobBTriggered).send() to transform events into job inputs (e.g., TenantCreated → tenant object).EventServiceProvider:
protected $listen = [
TenantCreated::class => [
JobPipeline::make([CreateDB::class, MigrateDB::class])
->send(fn($event) => $event->tenant)
->shouldBeQueued(true)
->toListener(),
],
];
Event::listen() in a service provider or bootstraper.Queue::fake() to test queued pipelines.CreateDB throws an exception).stancl/jobpipeline when breaking changes are introduced (e.g., PHP 8.5 compatibility).failed_jobs table. Use php artisan queue:failed-table to inspect.JobPipeline::make()->log() or Laravel’s Log::channel().php artisan queue:work), queue connections, and event listeners.return false logic in jobs.send() closure with dd($event->data).How can I help you explore Laravel packages today?