The next-generation blog, news, and article for you to start sharing your stories today!
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:
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.
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();
}
);
$query->lazyByIdDesc();
VerifyEmail
, this allows users to override the default URL generation logic without overriding the toMail()
method.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'])));
Illuminate/Auth/Notifications/ResetPassword::toMail()
(969f101)Read more at githhub
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.