Laravel 6.15.1 Released

News

February 18th, 2020

laravel6.jpg

The Laravel team released v6.15.1 this week to patch an issue with appending rows to artisan tables. In addition to the patch, new whereNull() and whereNotNull() methods were added to the collection class and a new MockStream class was added to the testing foundation:

New Collection Methods

Sjors Ottjes contributed a whereNull() and whereNotNull() method to the collections class. He outlined some examples in the pull request:

// Already available when building a query
$users = User::whereNotNull('email_verified_at')->get();

// But when you have a collection you have to do the this instead:
$users = User::all();
$unverifiedUsers = $users->whereStrict('is_verified_at', null);
$verifiedUsers = $users->where('is_verified_at', '!==', null);

With this PR you can now do the following:

$users = User::all();

$unverifiedUsers = $users->whereNull('is_verified_at');
$verifiedUsers = $users->whereNotNull('is_verified_at');

Adam Prickett contributed a new MockStream class to the testing foundation that you can see used in the follow test example:

MockStream::register($mock);
$stream = fopen('mock://stream', 'r+');
$consoleOutputSections = [];

$mock->shouldReceive('section')
    ->andReturn(new ConsoleSectionOutput(
        $stream,
        $consoleOutputSections,
        Output::VERBOSITY_NORMAL,
        false,
        new OutputFormatter)
    );

// ...
MockStream::restore();

Check out PR #31447 for further details.

You can see the full list of new features and updates below and the whole diff between 6.15.0 and 6.15.1 on GitHub. The full release notes for Laravel 6.0 are available in the latest v6 changelog:

v6.15.1

Added

  • Added whereNull and whereNotNull to Collection (#31425)
  • Added Illuminate\Foundation\Testing\MockStream class (#31447)

Fixed

  • Fixed event:list command for shows non-registered events (#31444)
  • Fixed postgres grammar for nested json arrays with (#31448, b3d0da1)

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.