My Blog Posts

Laravel 7.4.0 Released

Laravel 7.4.0 Released

Proxy for Collections

Loris Leiva, Collection::when()the method contributed to the ability to use a higher proxy:

// With this PR, this:
$collection->when($condition, function ($collection) use ($item) {
// ... can be refactored as this:

This PR allows you to chain other top proxy methods:

// This:
$collection->when($condition, function ($collection) {
// ... can be refactored as this:

Artisan expectsChoice() Assertion

Adrian Nuremberger contributed to a command test method to question the choices.

Given the following example:

$name = $this->choice('What is your name?', ['Taylor', 'Dayle'], $defaultIndex);

You can only get the answer to this query; you cannot test the given options.

-ExpectsQuestion('What is your name?', 'Taylor')

With Laravel 7.4, you can:

-expectsChoice('What is your name?', 'Taylor', ['Taylor', 'Dayle'])

You can also change the order of options by querying a fourth boolean argument:

-expectsChoice('What is your name?', 'Taylor', ['Taylor', 'Dayle'], true)

Default Values for @Props Blade Tag

@nihilsen contributed to the ability to identify default supports in the following ways @props:

@props(['type', 'message'])
$type = $type ?? 'info'

@props(['type' => 'info', 'message'])

Remove Order from The Query Builder

Jonathan Reinink reorder()orderBy()added a method to the query builder to reset calls:

$query = DB::table('users')-orderBy('name'); $unorderedUsers = $query->reorder()->get();

Reorder allows you to define the default layout in associated tables with the retreat feature as needed:

class Account extends Model
public function users()
return $this->hasMany(User::class)->orderBy('name');
// Remove the name orderBy and order by email
// The same can be written as:

Release notes

The full list of new features and updates is below and you can see the differences between 7.3.0 and 7.4.0 on GitHub. You can find all version notes for Laravel 7.x in the latest v7 change journal:



  • make:policycustomizable Brings ( # 32040 , 9d36a36 )
  • HigherOrderWhenProxyApplication for Collections ( # 32148 )
  • Illuminate\Testing\PendingCommand::expectsChoice()# 32139 )
  • Added support for default values for the "props" blade tag ( #32177 )
  • Added Castableinterface ( # 32129 , 9cbf908 , 651371a )
  • Added order removal feature from query builder ( #32186 )


  • PendingMailFake:::sendNow()And PendingMailFake::send()# 32093 ) added missing return for
  • Fixing Custom Model Features ( #32118 )
  • Fixed route group ( #32135 , 870efef )


  • Remove Swift Mailer bonds ( #32165 )
  • Add middleware.stub to files that will be published while running php artisan stub:publish# 32099 )
  • Php artisan stub:publish# 32100 ) add factory.stub to files that will be published when running
  • Add seeder.stub to files to be published while running php artisan stub:publish# 32122 )

Share this article

Comments (0)