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.

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

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

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
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
Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate logo

Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate

Build your SaaS application in hours. Out-of-the-box multi-tenancy and seamless Stripe integration. Supports subscriptions and one-time purchases, allowing you to focus on building and creating without repetitive setup tasks.

Supercharge Your SaaS Development with FilamentFlow: The Ultimate Laravel Filament Boilerplate
Rector logo

Rector

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

Rector
MongoDB logo

MongoDB

Enhance your PHP applications with the powerful integration of MongoDB and Laravel, empowering developers to build applications with ease and efficiency. Support transactional, search, analytics and mobile use cases while using the familiar Eloquent APIs. Discover how MongoDB's flexible, modern database can transform your Laravel applications.

MongoDB

The latest

View all →
Asymmetric Property Visibility in PHP 8.4 image

Asymmetric Property Visibility in PHP 8.4

Read article
Access Laravel Pulse Data as a JSON API image

Access Laravel Pulse Data as a JSON API

Read article
Laravel Forge adds Statamic Integration image

Laravel Forge adds Statamic Integration

Read article
Transform Data into Type-safe DTOs with this PHP Package image

Transform Data into Type-safe DTOs with this PHP Package

Read article
PHPxWorld - The resurgence of PHP meet-ups with Chris Morrell image

PHPxWorld - The resurgence of PHP meet-ups with Chris Morrell

Read article
Herd Executable Support and Pest 3 Mutation Testing in PhpStorm 2024.3 image

Herd Executable Support and Pest 3 Mutation Testing in PhpStorm 2024.3

Read article