Bulk Job Dispatching with Bus::bulk() in Laravel 13.13

Last updated on by

Bulk Job Dispatching with Bus::bulk() in Laravel 13.13 image

Never Miss a Laravel Release 🚀

Sign up and get an email with each new Laravel release

The Laravel team released v13.13.0 with a new method for dispatching many jobs in a single batch, storage-backed attachment helpers for notifications, PSR-18 support for the HTTP client, and a handful of validation and database fixes.

  • Bus::bulk() for efficient dispatching of many jobs
  • attachFromStorage() helpers on notification mail messages
  • HTTP client usable as a PSR-18 client
  • Cache attribute support for memoization
  • MariaDB vector index support
  • Validation and query builder bug fixes

What's New

Bus::bulk() for Dispatching Many Jobs

@jackbayliss added Bus::bulk(), which dispatches an array of jobs to the queue while grouping them by connection and queue so they can be pushed using the underlying bulk() queue method. Unlike Bus::batch(), it does not track batch progress in the database, so it fits cases where you want to enqueue many jobs without that overhead.

use Illuminate\Support\Facades\Bus;
 
Bus::bulk(array_map(fn (User $user) => new ProcessUser($user), $users));

PR: #60297

Storage Attachments for Notification Mail Messages

@LucasCavalheri added attachFromStorage() and attachFromStorageDisk() to the notification MailMessage class, bringing it in line with the attachment helpers already available on mailables.

(new MailMessage)
->attachFromStorage('/path/to/file')
->attachFromStorageDisk('s3', 'invoices/1.pdf', 'invoice.pdf', [
'mime' => 'application/pdf',
]);

PR: #60268

HTTP Client as a PSR-18 Client

@willrowe made the client returned by Http::buildClient() usable anywhere a Psr\Http\Client\ClientInterface is expected. You can hand Laravel's HTTP client to a third-party package that requires a PSR-18 client, so its requests run through the same middleware and handler stack as the rest of your application.

$geocoder = new GeocodingService(Http::buildClient());

PR: #60295

Cache Attribute Memoization

@jenky updated the Cache attribute to support injecting a memoized cache instance into constructors and resolve methods, building on the cache memoization added in earlier 13.x releases.

PR: #60309

MariaDB Vector Index Support

@michielvaneerd added vector index support for MariaDB in the schema builder.

PR: #60334

Validation and Query Fixes

This release also includes several fixes:

References

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Tinkerwell

Enjoy coding and debugging in an editor designed for fast feedback and quick iterations. It's like a shell for your application – but with multi-line editing, code completion, and more.

Visit Tinkerwell
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit

The latest

View all →
Monitor and Control Schedules, Queues, and Errors in Laravel with Watchtower image

Monitor and Control Schedules, Queues, and Errors in Laravel with Watchtower

Read article
Showcase Your PhpStorm Expertise on LinkedIn image

Showcase Your PhpStorm Expertise on LinkedIn

Read article
Privacy Filter: Detect PII in Text from Laravel image

Privacy Filter: Detect PII in Text from Laravel

Read article
NationForge: A Self-Hosted Admin Panel for Civic Organizations image

NationForge: A Self-Hosted Admin Panel for Civic Organizations

Read article
Monitor Laravel Queues, Commands, and Schedulers on Any Driver with Vigilance image

Monitor Laravel Queues, Commands, and Schedulers on Any Driver with Vigilance

Read article
Watch the Teaser for 'The Story of PHP' Documentary image

Watch the Teaser for 'The Story of PHP' Documentary

Read article