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
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.
event:listcommand for shows non-registered events (#31444)
- Fixed postgres grammar for nested json arrays with (#31448, b3d0da1)
Join 31,000+ others and never miss out on new tips, tutorials, and more.