Laravel 6.11.0 Is Here
Published on by Paul Redmond
Laravel 6.11 was released this week with a firstWhere
eloquent builder method, optimized multi-channel broadcasting in Redis, and the latest fixes and changes in the 6.x branch.
Eloquent firstWhere() method
Caleb Porzio contributed a firstWhere
method to the eloquent builder, which is a shortcut for where()->first()
:
// BeforeUser::where('emaill', 'foo@bar.com')->first(); // AfterUser::firstWhere('email', 'foo@bar.com');
This new method is only available in the eloquent builder and is not available in the query builder.
Optimize Redis Multi-channel Broadcasting
Josias Montag contributed an optimization for broadcasting to multiple channels in Redis:
It is pretty common in Laravel to send events to multiple channels at once. Currently, this results in multiple publish commands, all sending the same payload to the Redis server. This causes unnecessary data transfer (costs), especially if the payload is rather big.
You can check out the details of this in Pull Request #31108.
You can see the whole diff between 6.10.0 and 6.11.0 on GitHub. The full release notes for Laravel 6.0 are available in the GitHub in the v6 changelog:
v6.11.0
Added
- Added
Illuminate\Database\Eloquent\Builder::firstWhere()
method (#31089) - Redis Broadcaster: Broadcast to multiple channels at once (#31108)
Fixed
- Fixed undefined property in
WithFaker::makeFaker()
(#31083) - Fixed
Str::afterLast()
method (#31095) - Fixed insert float into MySQL with PHP 7.3 (#31100)
- Fixed refresh on Model with customized pivot attribute name (#31125, 678b26b)