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

Interruptible Jobs in Laravel 13.7.0

Last updated on by

Interruptible Jobs in Laravel 13.7.0 image

Never Miss a Laravel Release 🚀

Sign up and get an email with each new Laravel release

Laravel v13.7.0 introduces the Interruptible interface for queued jobs to respond to worker signals, a new @fonts Blade directive for Vite font optimization, bulk JSON path assertions for testing, SortDirection enum support in collections, and several other improvements across the framework.

  • Jobs can now react to worker signals via the Interruptible interface
  • New WorkerInterrupted event for observability
  • New @fonts Blade directive and Vite font optimization runtime
  • Bulk JSON path assertions in TestResponse
  • SortDirection enum support for collections and Arr
  • Enum support for LazyCollection keyBy()
  • Various bug fixes and improvements

What's New

Jobs Can React to Worker Signals

Queued jobs can now implement the Interruptible interface to respond when a worker receives a signal like SIGTERM. This lets long-running jobs clean up or set a stop flag before the worker exits:

use Illuminate\Contracts\Queue\Interruptible;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Queue\Queueable;
 
class ReportJob implements ShouldQueue, Interruptible
{
use Queueable;
 
protected bool $stop = false;
 
public function handle(): void
{
while (! $this->stop) {
// do work...
}
}
 
public function interrupted(int $signal): void
{
$this->stop = true;
}
}

PR: #59833

New @fonts Blade Directive and Vite Font Optimization

This release adds a new @fonts Blade directive and Vite::fonts() method for rendering font preload links and inline styles. The feature reads font manifests generated by the Vite plugin and supports selective family loading.

Basic usage in your layout:

<!DOCTYPE html>
<html>
<head>
@fonts
@vite('resources/js/app.js')
</head>
<body>
{{ $slot }}
</body>
</html>

This renders preload <link> tags and an inline <style> block with all @font-face rules and CSS variables from the font manifest.

You can also filter to load only specific font families:

{{-- Load a single family --}}
@fonts('sans')
 
{{-- Load multiple families --}}
@fonts(['sans', 'mono'])

PR: #59584

Bulk JSON Path Assertions in TestResponse

The testing layer now includes assertJsonPaths() and assertJsonMissingPaths() methods for asserting multiple JSON values at once.

Before:

$response->assertJsonPath('data.id', 1)
->assertJsonPath('data.name', 'Taylor')
->assertJsonPath('meta.count', 3);

After:

$response->assertJsonPaths([
'data.id' => 1,
'data.name' => 'Taylor',
'meta.count' => 3,
]);

The companion assertJsonMissingPaths() method works the same way for asserting absent keys:

$response->assertJsonMissingPaths(['password', 'secret_token']);

PR: #59829

SortDirection Enum Support for Collections

Collections and the Arr class now support the SortDirection enum for specifying sort order, providing better type safety when sorting:

use SortDirection;
 
$sorted = $collection->sortBy('name', descending: SortDirection::Descending);

PR: #59859

Introducing WorkerInterrupted Event

A new WorkerInterrupted event is dispatched when a worker receives a signal, before it stops. This is useful for observability — you can log, alert, or call an external service when a signal arrives, even if the individual job doesn't implement Interruptible.

PR: #59848

isLocked Method Added to Lock Class

The Lock class now includes an isLocked() method to check the current lock status.

PR: #59791

Enum Support for LazyCollection keyBy()

LazyCollection::keyBy() now accepts a BackedEnum, matching the behavior already available in Collection. Previously, passing an enum would throw an error when attempting to convert it to a string.

PR: #59809

Miscellaneous Fixes and Improvements

This update includes enum support improvements across ConcurrencyManager, QueueManager, LogManager, SessionManager, and RedisManager. Various docblock improvements, type corrections, and bug fixes from community contributors are also included.

Upgrade Notes

No breaking changes are expected for typical applications. Review the changelog for PR-by-PR details when upgrading.

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
Acquaint Softtech

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

Visit Acquaint Softtech
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Shift logo

Shift

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

Shift
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
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
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
PhpStorm logo

PhpStorm

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

PhpStorm
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
SerpApi logo

SerpApi

Access real-time search engine results through a simple API—no more scraping headaches! Use it for AI applications, SEO tools, product research, travel information, and more

SerpApi
Lucky Media logo

Lucky Media

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

Lucky Media

The latest

View all →
Storage Cache Store in Laravel 13.10.0 image

Storage Cache Store in Laravel 13.10.0

Read article
Laravel MongoDB Full-Text Search tutorial: The Art of the Relevancy image

Laravel MongoDB Full-Text Search tutorial: The Art of the Relevancy

Read article
Drag-and-Drop Sorting for Eloquent Models with Reorderable for Laravel image

Drag-and-Drop Sorting for Eloquent Models with Reorderable for Laravel

Read article
Ship AI with Laravel: Real-Time Streaming Chat UI with Livewire image

Ship AI with Laravel: Real-Time Streaming Chat UI with Livewire

Read article
Frontend Nation 2026 Returns June 3-4 with Laravel in the Lineup image

Frontend Nation 2026 Returns June 3-4 with Laravel in the Lineup

Read article
Use a Google Sheet as Your Laravel Database with the Google Sheets Database Driver image

Use a Google Sheet as Your Laravel Database with the Google Sheets Database Driver

Read article