News

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

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

Release updates

Never miss a Laravel release

Get an email whenever a new Laravel release lands.

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.

Sponsored

acquaintsoft logo
Acquaint Softtech

Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Visit Acquaint Softtech

The latest

View all →
CPX: The Composer Package Executor for PHP image

CPX: The Composer Package Executor for PHP

Read article
Laravel AI SDK Adds Human-in-the-Loop Tool Approval image

Laravel AI SDK Adds Human-in-the-Loop Tool Approval

Read article
Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals image

Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals

Read article
Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs image

Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs

Read article
Blade Formatting in Laravel Pint image

Blade Formatting in Laravel Pint

Read article
Inertia DevTools Is Now on the Chrome Web Store image

Inertia DevTools Is Now on the Chrome Web Store

Read article