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

Queue-Wide Inspection Methods in Laravel 13.8.0

Published on by

Queue-Wide Inspection Methods in Laravel 13.8.0 image

Never Miss a Laravel Release 🚀

Sign up and get an email with each new Laravel release

Laravel v13.8.0 adds methods for inspecting jobs across all queues in a single call, plus new worker pause/resume events, assertSessionMissingInput() for testing, SortDirection enum support in the query builder, and more:

  • allReservedJobs(), allDelayedJobs(), and allPendingJobs() queue inspection methods
  • Worker Pausing and Resuming events
  • assertSessionMissingInput() test assertion
  • SortDirection enum support for query builder orderBy() and related methods
  • Environment filter for the schedule:list command
  • Custom onDelete()/onUpdate() actions for foreign keys
  • Attribute-provided middleware now merges with route middleware
  • Mail default driver now accepts backed enums
  • Named credential providers for SQS queue connections
  • Various type fixes and docblock improvements

What's New

Queue-Wide Inspection Methods

The existing Queue::reservedJobs(), Queue::delayedJobs(), and Queue::pendingJobs() methods require a specific queue name, which means checking multiple queues requires chaining calls. This release adds allReservedJobs(), allDelayedJobs(), and allPendingJobs() to retrieve jobs across every queue in a single call:

// Before — one query per queue
Queue::reservedJobs('queue1')
->merge(Queue::reservedJobs('queue2'))
->merge(Queue::reservedJobs('queue3'));
 
// After — one call for all queues
Queue::allReservedJobs();
Queue::allDelayedJobs();
Queue::allPendingJobs();

Each method returns a collection of InspectedJob instances with uuid, name, attempts, and createdAt properties. This is useful during deployments when you need to confirm no jobs are actively running before stopping workers. The methods work with the database, Redis, and fake queue drivers.

PR: #59997

Worker Pausing and Resuming Events

Two new events — WorkerPausing and WorkerResuming — are now dispatched when a queue worker receives SIGUSR2 or SIGCONT signals respectively. These events give applications visibility into worker state transitions, useful for logging or alerting when workers pause and resume during deployments.

PR: #59895

assertSessionMissingInput() Test Assertion

TestResponse now includes assertSessionMissingInput() as the counterpart to the existing assertSessionHasInput(). It accepts a single field name or an array of field names:

$response->assertSessionMissingInput('name');
 
$response->assertSessionMissingInput(['connection_id', 'repository', 'source_branch']);

PR: #59970

SortDirection Enum in Query Builder

Following the SortDirection enum support added to collections in 13.7.0, query builder methods like orderBy(), orderByDesc(), and orderByRaw() now accept the native PHP SortDirection enum (introduced in PHP 8.6):

use SortDirection;
 
DB::table('users')
->orderBy('name', SortDirection::Descending)
->get();

PR: #59865

Environment Filter for schedule:list

The schedule:list Artisan command now accepts an --environment option to filter scheduled tasks by the environments they run in:

php artisan schedule:list --environment=production

This is helpful when running schedule:list on production to see only the commands that will actually execute in that environment, rather than seeing commands restricted to local or staging.

PR: #59993

Custom onDelete()/onUpdate() Actions for Foreign Keys

The ForeignKeyDefinition class now accepts custom strings for onDelete() and onUpdate() beyond the standard cascade, restrict, no action, and set null. This resolves a PHPStan conflict when using PostgreSQL's partial SET NULL syntax for composite foreign keys:

$table->foreign(['document_id', 'client_id'])
->references(['id', 'client_id'])
->on('documents')
->onDelete('set null (document_id)');

PR: #59986

Attribute Middleware Now Merges with Route Middleware

Previously, the #[Middleware] attribute on a controller or method was ignored if the route also had middleware defined through other means. Attribute-provided middleware now merges with middleware from other sources instead of being discarded.

PR: #59944

Named Credential Providers for SQS

SQS queue connections now support named AWS credential providers, which allows using specific credential profiles or chains defined in the AWS SDK rather than only environment variables or instance metadata:

// config/queue.php
'sqs' => [
'driver' => 'sqs',
'credentials' => 'my-named-provider',
// ...
],

PR: #59754

Mail Default Driver Accepts Enums

MailManager::setDefaultDriver() now accepts backed enums in addition to strings, matching the enum support already available in mailer() and driver():

Mail::setDefaultDriver(MailDriver::Smtp);

PR: #59973

Miscellaneous Fixes and Improvements

This release includes a large set of type annotation and docblock improvements from @mosabbirrakib, @AJenbo, @jnoordsij, and others — covering schema builders, cache, factory, collections, and more. Additional fixes include: expired locks now excluded from DatabaseLock::isLock, fixes for macros with static closures, ModelNotFoundException UnitEnum support, infinite rate limiter TTL on custom increments, and callable type corrections for freezeTime and travelTo.

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
SerpApi

The Web Search API for Your LLM and AI Applications

Visit SerpApi
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
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
Tinkerwell logo

Tinkerwell

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

Tinkerwell
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
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
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
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

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

Shift
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

The latest

View all →
Malware Blocking and Dependency Policies in Composer 2.10 image

Malware Blocking and Dependency Policies in Composer 2.10

Read article
Aegis for Laravel: Scaffolding and Validation Helpers for Value Objects image

Aegis for Laravel: Scaffolding and Validation Helpers for Value Objects

Read article
Playa: Cookie-Based Temporary Players for Laravel image

Playa: Cookie-Based Temporary Players for Laravel

Read article
Scheduler Attributes and Listener Discovery Control in Laravel 13.12.0 image

Scheduler Attributes and Listener Discovery Control in Laravel 13.12.0

Read article
The PHP Foundation Launches an Ecosystem Security Team image

The PHP Foundation Launches an Ecosystem Security Team

Read article
Manage Subscription Plans and Entitlements in Laravel with Laravel Entitlements image

Manage Subscription Plans and Entitlements in Laravel with Laravel Entitlements

Read article