The artisan dev Command in Laravel 13.16.0

Published on by

The artisan dev Command in Laravel 13.16.0 image

The Laravel team released v13.16.0 with a new artisan dev command for running your development processes, an enum-aware request helper, a withCookies() method on all responses, and an array-based maintenance mode driver for parallel testing.

  • php artisan dev command to run server, queue, logs, and Vite concurrently
  • whenFilledEnum() method on requests for typed enum handling
  • withCookies() promoted from redirects to all response types
  • An array maintenance mode driver for parallel testing

What's New

The artisan dev Command

The release adds a php artisan dev command that runs your development processes (server, queue worker, log tailing, and Vite) concurrently. By default its behavior matches the existing composer dev script, but it moves the configuration into your application code instead of composer.json.

Commands are registered through the DevCommands class, typically from a service provider. You can add Artisan commands or arbitrary shell commands to the set:

use Illuminate\Foundation\Console\DevCommands;
 
DevCommands::artisan('reverb:start');
DevCommands::register('stripe listen --forward-to ' . config('app.url'));

An optional second argument names the process; otherwise the name is the first segment before the first space. You can also assign a color per process:

DevCommands::artisan('reverb:start', 'reverb')->orange();
DevCommands::register('stripe listen --forward-to ' . config('app.url'))->green();

DevCommands prevents packages in the vendor directory from registering commands automatically. A package can still expose a helper that registers commands from your own code. The PR also adds a NodePackageManager helper that detects the package manager from the lockfiles present (npm, yarn, pnpm, or bun) so a generic command resolves to the right runner. See #60412.

Note: upgrade to v13.16.1, which has a fix for registering artisan dev command.

whenFilledEnum() Request Method

The InteractsWithData trait gains a whenFilledEnum() method that converts a request value to a backed enum before invoking the callback. Previously this meant calling whenFilled(), then tryFrom(), then a null check by hand:

$request->whenFilledEnum('status', Status::class, function (Status $status) use ($query): void {
$query->where('status', $status);
});

The callback runs only when the key is filled, the given class is a backed enum, and the value casts to a valid case via tryFrom(). Invalid values are skipped without throwing. An optional default callback runs when the primary callback does not:

$request->whenFilledEnum('status', Status::class, function (Status $status) use ($query): void {
$query->where('status', $status);
}, function () use ($query): void {
$query->where('status', Status::Active);
});

See #60486.

withCookies() on All Responses

The withCookies() method moves from RedirectResponse to ResponseTrait, so you can attach multiple cookies to any response type, including JsonResponse and standard responses, in a single call rather than chaining withCookie():

return response()->json($data)->withCookies([$cookieA, $cookieB, $cookieC]);

The change is additive and non-breaking. See #60503.

array Maintenance Mode Driver

A new array-based maintenance mode driver joins the existing file and cache drivers. It is aimed at parallel testing, where the file driver and Cache facade mocking can trip up tests that call php artisan up and down. See #60489.

Enums in broadcastAs()

Broadcast events can now return an enum from broadcastAs() for the event name. Paired with a typed SDK generator, this keeps event names consistent on both the sending and receiving sides, matching how the #[Queue()] attribute already supports enums. See #60483.

JSON Schema anyOf and Safer Deserialization

The JsonSchema component adds anyOf support, and the deserializer is now guarded against unbounded $ref expansion to prevent runaway recursion. See #60509 and #60517.

Other Fixes and Improvements

  • Fixed shell quoting when scheduled commands run as another user (#60469)
  • Allowed RouteParameter to use the attributed parameter name (#60465)
  • Fixed Batchable::batching for finished batches (#60511)
  • Added support for queue attributes on traits (#60519)
  • Hardened HTTP client request and fake response serialization (#60522)
  • Improved return types across model scopes, connection callbacks, and callback-passthrough helpers (#60481, #60484, #60500, #60513)

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
Laravel Cloud logo

Laravel Cloud

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

Laravel Cloud
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
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
Shift logo

Shift

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

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

Tinkerwell

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

Tinkerwell
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum

The latest

View all →
How We Cached Laravel News at the Edge with Fast Laravel image

How We Cached Laravel News at the Edge with Fast Laravel

Read article
LaraOwl: Self-Hosted Monitoring for Laravel Applications image

LaraOwl: Self-Hosted Monitoring for Laravel Applications

Read article
Filament Storage Monitor: Track Disk Usage From Your Filament Dashboard image

Filament Storage Monitor: Track Disk Usage From Your Filament Dashboard

Read article
Subscriptionify: Feature-Based Subscription Management for Laravel image

Subscriptionify: Feature-Based Subscription Management for Laravel

Read article
Toolkit: Reusable AI Tools for the Laravel AI SDK image

Toolkit: Reusable AI Tools for the Laravel AI SDK

Read article
Laracon US 2026 Reveals Its Full Speaker Lineup image

Laracon US 2026 Reveals Its Full Speaker Lineup

Read article