logo

The next-generation blog, news, and article for you to start sharing your stories today!

Laravel Minor 8.73 Released

Laravel Minor 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)

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

See: https://salsa.debian.org/php-team/php/-/blob/debian/main/7.4/debian/php-cgi.conf#L5-7

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)

Cache::remember(
    'count_events_hosted',
    // Now you can pass a Closure to calculate TTL
    function () use ($user) {
        // Expire when closest event ends
        $closestEventEndsAt = $user->hostedEvents()
            ->select('ends_at')
            ->where('starts_at', '>', Date::now())
            ->orderBy('ends_at')
            ->limit(1)
            ->value('ends_at');
 
        return $closestEventEndsAt ?
            Date::parse($closestEventEndsAt) :
            60;
    },
    function () use ($user) {
        return $user->hostedEvents()->ended()->count();
    }
);

 

Implement lazyByIdDesc in descending order (8.73)

$query->lazyByIdDesc();

 

PasswordReset Method for Reset URL (8.72)

  • Added extra method in PasswortReset for reset URL to match the structure of VerifyEmail (#39652)
  • 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)

  • Added support for countables to the Illuminate/Support/Pluralizer::plural() (#39641)
  • // 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'])));

 

 

More..

Revert

v8.73.0 (2021-11-19)

Added

  • 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

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

Read more at githhub

https://github.com/laravel

Laravel Minor 8.73 Released

avatar

Vikram Parihar

An editor at Keyscript

Vikram Parihar is an senior software engineer. He is working since 2013 in web development technologies. He works in NodeJS, Angular, Vue, PHP, Laravel, Express JS and various popular technologies.