Laravel 6.15.1 Released
Published on by Paul Redmond
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
andwhereNotNull
toCollection
(#31425) - Added
Illuminate\Foundation\Testing\MockStream
class (#31447)