Laravel 8.73 Released


November 23rd, 2021

Laravel 8.73 Released

The Laravel team released 8.73 with support for Countable objects in the string pluralizer, allowing closures for determining cache TTL, a lazyByIdDesc() query builder method, and the latest changes in the v8.x branch.

This post includes a few releases that happened over the last few days, including a revert in 8.73.1, so be sure to update to the latest 8.x version:

Add .phar To Blocked PHP Extensions (8.73)

Stephen Rees-Carter contributed adding the .phar extension to blocked PHP extensions during file upload:

By default Debian includes support for executing .phar files alongside .php and .phtml files, and should be included in the blocked list.


This should also be backported into all currently supported versions of Laravel.

Allow a Closure to be Passed as a TTL in Cache remember() method (8.73)

Gerard Nesta contributed the ability to pass a Closure as a TTL in the Cache::remember() method:

// Now you can pass a Closure to calculate TTL
function () use ($user) {
// Expire when closest event ends
$closestEventEndsAt = $user->hostedEvents()
->where('starts_at', '>', Date::now())
return $closestEventEndsAt ?
Date::parse($closestEventEndsAt) :
function () use ($user) {
return $user->hostedEvents()->ended()->count();

Implement lazyByIdDesc in descending order (8.73)

Moshe Brodsky contributed a lazyByIdDesc() method, which queries lazily by chunking the results of a query by comparing IDs in descending order:


This is useful when dealing with a lot of data and you want the "newer" objects processed first.

PasswordReset Method for Reset URL (8.72)

Oliver Kaufmann contributed moving the reset URL generation into a separate method for the PasswordReset notification. Similar to VerifyEmail, this allows users to override the default URL generation logic without overriding the toMail() method.

Add Support for Countables to the Pluralizer (8.72)

Michael Dyrynda added support for countable values to the Str::plural() method. You can now pass anything that passes PHP's is_countable() check that implements Countable as the second parameter of plural:

// Arrays
$this->assertSame('users', Str::plural('user', []));
$this->assertSame('user', Str::plural('user', ['one']));
$this->assertSame('users', Str::plural('user', ['one', 'two']));
// Collections
$this->assertSame('users', Str::plural('user', collect()));
$this->assertSame('user', Str::plural('user', collect(['one'])));
$this->assertSame('users', Str::plural('user', collect(['one', 'two'])));

Release Notes

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





  • Added .phar to blocked PHP extensions in validator (#39666)
  • Allow a Closure to be passed as a ttl in Cache remember() method (#39678)
  • Added Prohibits validation rule to dependentRules property (#39677)
  • Implement lazyById in descending order (#39646)


  • Fixed Illuminate/Auth/Notifications/ResetPassword::toMail() (969f101)
  • Fixed assertSoftDeleted & assertNotSoftDeleted (#39673)



  • Added extra method in PasswortReset for reset URL to match the structure of VerifyEmail (#39652)
  • Added support for countables to the Illuminate/Support/Pluralizer::plural() (#39641)
  • Allow users to specify options for migrate:fresh for DatabaseMigration trait (#39637)


  • Casts $value to the int only when not null in Illuminate/Database/Query/Builder::limit() (#39644)


  • Use parents to resolve middleware priority in SortedMiddleware (#39647)

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.