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
// Before User::where('emaill', 'firstname.lastname@example.org')->first(); // After User::firstWhere('email', 'email@example.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.
- Redis Broadcaster: Broadcast to multiple channels at once (#31108)
- Fixed undefined property in
- Fixed insert float into MySQL with PHP 7.3 (#31100)
- Fixed refresh on Model with customized pivot attribute name (#31125, 678b26b)