Laravel 5.7.19 Released

Laravel 5.7.19 Released

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.

A new 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()
);

The 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 (<=).

You can see the full list of fixes below, and the full diff between 5.7.18 and 5.7.19 on GitHub. The full release notes for Laravel 5.7 are available in the GitHub 5.7 changelog:

v5.7.19

Added

  • Added Illuminate\Support\Collection::whereBetween method (#26888)

Fixed

  • Reverted changes related to app()->call() (fefaf46)
  • Reset doctrineConnection property on Database/Connection when reconnecting (#26890)


Filed in: News / Releases


Newsletter

Join the weekly newsletter and never miss out on new tips, tutorials, and more.

Laravel News Partners

Laravel Jobs

Senior Full-Stack Developer (PHP+JS)
Remote
The Interaction Design Foundation
Senior Laravel Developer
Remote
Sonar
Laravel / Vue.JS Developer - Join an amazing team!
Remote
JTR Solutions
Mid / Sen. Software Engineer
Clearwater, FL
ShineOn
Remote PHP / Laravel Developer
Remote
SpringboardVR
Senior PHP/Laravel Developer: Your Dream Work Environment
Remote
iPhone Photography School
Senior Laravel Developer
Leidseplein, Amsterdam
Orderchamp.com