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
Larafast: Laravel SaaS Starter Kit

Larafast is a Laravel SaaS Starter Kit with ready-to-go features for Payments, Auth, Admin, Blog, SEO, and beautiful themes.

Visit Larafast: Laravel SaaS Starter Kit
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
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $2500/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
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
LaraJobs logo

LaraJobs

The official Laravel job board

LaraJobs
All Green logo

All Green

All Green is a SaaS test runner that can execute your whole Laravel test suite in mere seconds so that you don't get blocked – you get feedback almost instantly and you can deploy to production very quickly.

All Green
Larafast: Laravel SaaS Starter Kit logo

Larafast: Laravel SaaS Starter Kit

Larafast is a Laravel SaaS Starter Kit with ready-to-go features for Payments, Auth, Admin, Blog, SEO, and beautiful themes. Available with VILT and TALL stacks.

Larafast: Laravel SaaS Starter Kit
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a 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
Rector logo

Rector

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

Rector

The latest

View all →
Property Hooks Get Closer to Becoming a Reality in PHP 8.4 image

Property Hooks Get Closer to Becoming a Reality in PHP 8.4

Read article
Asserting Exceptions in Laravel Tests image

Asserting Exceptions in Laravel Tests

Read article
Reversible Form Prompts and a New Exceptions Facade in Laravel 11.4 image

Reversible Form Prompts and a New Exceptions Facade in Laravel 11.4

Read article
Basset is an alternative way to load CSS & JS assets image

Basset is an alternative way to load CSS & JS assets

Read article
Integrate Laravel with Stripe Connect Using This Package image

Integrate Laravel with Stripe Connect Using This Package

Read article
The Random package generates cryptographically secure random values image

The Random package generates cryptographically secure random values

Read article