Laravel 9.45 Released

Published on by

Laravel 9.45 Released image

The Laravel team released 9.45 this week with custom component search paths, a new validation rule, router convenience for ULID route params, and more:

Custom component search paths

Taylor Otwell contributed the registration of root-level anonymous component search paths. This is convenient for projects that have components in various locations.

To configure a search path, add the following to the boot() method within a registered service provider:

 
Blade::anonymousComponentPath(__DIR__.'/../components');
// I.e., `<x-panel />`
 
// With a prefixed namespace
Blade::anonymousComponentPath(
__DIR__.'/../components',
'dashboard'
);
 
// I.e., `<x-dashboard::panel />`

See theAnonymous Component Paths documentation for further details.

Decimal validation rule

@Pusparaj contributed a decimal validation rule with a min, max configuration. Here are a few examples from the pull request tests:

// Passes validation
$v = new Validator($trans, ['foo' => '1.234'], ['foo' => 'Decimal:2,3']);
$this->assertTrue($v->passes());
 
// Fails validation
$v = new Validator($trans, ['foo' => '1.2345'], ['foo' => 'Decimal:2,3']);
$this->assertFalse($v->passes());

Here's how the rule works:

  1. decimal:2 is exactly two digits on the fractional part
  2. decimal:2,3 either two or three digits on the fractional part
  3. decimal:0,3 values must have at most three digits in the fractional part and can include zero digits (i.e., integer)

"whereUlid()" Route Support

Jamshed Javed contributed whereUlid() route support to the collection of commonly-used regular expressions. Given you want a route id param to match a ULID, you'd use the following now:

Route::get('/user/{id}', function ($id) {
//
})->whereUlid('id');

Release Notes

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

v9.45.0

Added

  • Allows the registration of custom, root-level anonymous component search paths. (#45338, 1ff0379)
  • Added decimal validation rule (#45356, e89b2b0)
  • Added align property to button mail component (#45362)
  • Added whereUlid(param) support for routing (#45372)

Fixed

  • Fixed single line @php statements to not be parsed as php blocks in BladeCompiler (#45333)
  • Added missing code to set locale from model preferred locale in Maillable (#45308)

Changed

  • Vite: ability to prevent preload tag generation from attribute resolver callback (#45283)
  • Deprecation Test Improvements (#45317)
  • Do not allow nested arrays in whereIn method (140c3a8)
  • Bump ramsey/uuid (#45367)
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
Tinkerwell

Version 4 of Tinkerwell is available now. Get the most popular PHP scratchpad with all its new features and simplify your development workflow today.

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