Laravel 5.7.19 is available with a new
whereBetween collection method. This version also reverts a change to
app()->call() introduced in Laravel 5.7.18.
Collection::whereBetween() provides a way to filter collections between two values. Here’s an example from the pull request’s tests:
$c = new Collection([ ['v' => 1], ['v' => 2], ['v' => 3], ['v' => '3'], ['v' => 4] ]); $this->assertEquals( [ ['v' => 2], ['v' => 3], ['v' => '3'], ['v' => 4] ], $c->whereBetween('v', [2, 4])->values()->all() );
whereBetween method’s second argument felt a bit weird to me at first. However, the first array value is the lower bound (
>=) and the second array value is the upper (
- Reverted changes related to
- Reset doctrineConnection property on Database/Connection when reconnecting (#26890)
Join the weekly newsletter and never miss out on new tips, tutorials, and more.
- Senior PHP/Laravel Developer: Your Dream Work Environment
iPhone Photography School
- In-house Laravel Developer.
Gold Coast / Australia
- Laravel Developer
Oak Brook, IL
- Senior Backend Engineer
Santa Monica only
- Senior Laravel Developer
- Senior Software Developer
South Jordan, UT
- Full-Stack Developer