Laravel 6.11 released with a firstWhere eloquent builder method.

Dhruv Raval
1 min readJan 22, 2020

--

Laravel 6

Laravel v6.11.0 was released in 14 Jan 2020 with a new eloquent method firstWhere and other fixes and other changes in 6.x branch.

firstWhere() method

This is a shortcut of where()->first() and contributed by the Caleb Porzio. (31089). This new method is only available in the eloquent builder.

// Before
User::where('username', 'foo')->first();
//After
User::firstWhere('username', 'foo');

Added

  1. Added Illuminate\Database\Eloquent\Builder::firstWhere() method (#31089)
  2. Redis Broadcaster: Broadcast to multiple channels at once (#31108)

Fixed

  1. Fixed undefined property in WithFaker::makeFaker() (#31083)
  2. Fixed Str::afterLast() method (#31095)
  3. Fixed insert float into MySQL with PHP 7.3 (#31100)
  4. Fixed refresh on Model with customized pivot attribute name (#31125, 678b26b)

Changed

  1. Remove all indentation in blade templates (917ee51)
  2. Added mailable names to assertion messages in MailFake::assertNothingSent() and MailFake::assertNothingQueued() (#31106)
  3. Search for similar results in assertDatabaseHas() (#31042, 2103eb7)

The full release note for Laravel 6.11 is available in the GitHub. Check here.

--

--