Laravel 10.9 Released

Published on by

Laravel 10.9 Released image

The Laravel team has released version 10.9 with several new features and enhancements. Among the changes are named static methods for middleware, new HTTP status assertions for feature testing, and the ability to prune all canceled and unfinished queue batches.

Additionally, Ignition IDE links with work with the artisan serve command, which allows them to open files in their IDE by clicking on the filename displayed on an Ignition error page.

Let's look at the features and changes introduced in Laravel 10.9:

Named Static Methods for Middleware

Tim MacDonald continued enhancing alternative more "PHPish" ways to define route middleware. Here are some examples from Pull Request #46362:

Route::get('users', UserController::class)
->middleware([
Authenticate::class, // default.
Authenticate::using('web'), // specify a guard.
Authenticate::using('web', 'another'), // specify multiple guards.
 
Authorize::using('store', Post::class),
 
EnsureEmailIsVerified::class, // default.
EnsureEmailIsVerified::redirectTo('route.name'),
]);

New HTTP Status Assertions

Miran AL Mehrab contributed three new HTTP status assertions for writing feature tests in Laravel:

$response->assertGone(); // 410
$response->assertInternalServerError(); // 500
$response->assertServiceUnavailable(); // 503

Allow Pruning All Cancelled and Unfinished Queue Batches

James Hulse contributed an update to queue:prune-batches that allows you to prune unfinished and canceled batches with the --infinished=0 and --cancelled=0 flags. Now, the code will check for non-null values. See Pull Request #46833 for more details.

Configure Ignition IDE Links With artisan serve

Niclas contributed the ability to pass-through IGNITION_LOCAL_SITES_PATH to the artisan serve command, which enables you to open files in your IDE by clicking on the filename displayed on an Ignition error page.

See Pull Request #46857 for further details.

Release Notes

You can see the complete list of new features and updates below and the diff between 10.8.0 and 10.9.0 on GitHub. The following release notes are directly from the changelog:

v10.9.0

Added

  • Add new HTTP status assertions (#46841)
  • Allow pruning all cancelled and unfinished queue batches (#46833)
  • Added IGNITION_LOCAL_SITES_PATH to $passthroughVariables in ServeCommand.php (#46857)
  • Added named static methods for middleware (#46362)

Fixed

  • Fix date_format rule throw ValueError (#46824)

Changed

  • Allow separate directory for locks on filestore (#46811)
  • Allow to whereMorphedTo work with null model (#46821)
  • Use pivot model fromDateTime instead of assuming Carbon in Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable::addTimestampsToAttachment() (#46822)
  • Make rules method in FormRequest optional (#46846)
  • Throw LogicException when calling FileFactory@image() if mimetype is not supported (#46859)
  • Improve job release method to accept date instance (#46854)
  • Use foreignUlid if model uses HasUlids trait when call foreignIdFor (#46876)
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
DocuWriter.ai

Save hours of manually writing Code Documentation, Comments & DocBlocks, Test suites and Refactoring.

Visit DocuWriter.ai
Laravel Forge logo

Laravel Forge

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

Laravel Forge
Tinkerwell logo

Tinkerwell

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

Tinkerwell
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 $7500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
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
LoadForge logo

LoadForge

Easy, affordable load testing and stress tests for websites, APIs and databases.

LoadForge
Paragraph logo

Paragraph

Manage your Laravel app as if it was a CMS – edit any text on any page or in any email without touching Blade or language files.

Paragraph
Lucky Media logo

Lucky Media

Bespoke software solutions built for your business. We ♥ Laravel

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
Bacancy - Staff Augmentation logo

Bacancy - Staff Augmentation

Leave your web app development hustles to the leading IT Staff Augmentation Service Providers. Choose from an extensive pool of 1050+ developers and give yourself the sigh of success you deserve with Bacancy. Get In Touch Today!

Bacancy - Staff Augmentation
DocuWriter.ai logo

DocuWriter.ai

Save hours of manually writing Code Documentation, Comments & DocBlocks, Test suites and Refactoring.

DocuWriter.ai
Rector logo

Rector

Your partner for seamless Laravel upgrades, cutting costs, and accelerating innovation for successful companies

Rector

The latest

View all →
October CMS v3.6 Ships Today, Full of New Features image

October CMS v3.6 Ships Today, Full of New Features

Read article
Laracon EU Videos are now out image

Laracon EU Videos are now out

Read article
Use Google's Gemini AI in Laravel image

Use Google's Gemini AI in Laravel

Read article
PhpStorm is getting a brand new terminal image

PhpStorm is getting a brand new terminal

Read article
Six Essential Plugins for Visual Studio Code image

Six Essential Plugins for Visual Studio Code

Read article
Modularize Your Laravel Application With the Modular Package image

Modularize Your Laravel Application With the Modular Package

Read article