Laravel Job Batching for Large Background Tasks
Job batches in Laravel let you run many related jobs as a single unit, with progress tracking and cancellation. Here's when to use them and how to set them up.
If you have ever needed to run a thousand related jobs and report progress to the user, you have probably reinvented this from scratch. Laravel's job batching feature, added a few versions back, gives you that pattern out of the box.
What batches solve
A batch is a group of jobs dispatched together with a shared identity. You can track how many have completed, cancel the whole batch, run a callback when it finishes, and run a different callback if any job inside it fails. All four are common needs that used to require a custom progress table and a custom dispatcher.
Setting one up
php$batch = Bus::batch([
new ImportRow($row1),
new ImportRow($row2),
// ...
])->then(function (Batch $batch) {
// all jobs done
})->catch(function (Batch $batch, Throwable $e) {
// first failure
})->finally(function (Batch $batch) {
// ran whether or not failures occurred
})->dispatch();
return ['batch_id' => $batch->id];You can then load the batch by ID with Bus::findBatch($id) and check progress: $batch->totalJobs, $batch->processedJobs(), $batch->progress(). It is a lot of useful behavior for a small amount of code.
When not to use batches
Batches add a few rows to the job_batches table per dispatch and a progress check on every job completion. For a firehose of unrelated jobs (signups, emails, webhook deliveries), this overhead is wasted — those should be plain queued jobs.
Batches earn their keep when the user wants to know the status. CSV imports, bulk emails to a known list, and large recalculation jobs all benefit. If no one is ever going to ask "is it done yet," plain jobs are simpler and cheaper.
About the author

Richard Gamora
Fullstack developer based in the Philippines, working mostly with Laravel and Vue.js, with eight years of production experience across web and mobile.
More on Laravel
April 22, 2026
Why Laravel Queue Workers Stop — Common Causes and Fixes
Laravel queue workers can quietly stop processing jobs in production. Here's how to spot the common causes — memory limits, restarts, lost DB connections — and fix them.
April 15, 2026
Laravel N+1 Query Problem: How to Spot and Solve It
The N+1 query problem is the most common performance issue in Laravel apps. Here's how to detect it with the query log, fix it with eager loading, and prevent it from coming back.
April 8, 2026
Laravel API Resources vs Fractal — Which Should You Use
Laravel API Resources and Fractal both transform models into JSON. Here's how they compare on flexibility, includes, performance, and team ergonomics.