My Blog Posts

Laravel 7.15 Released

Laravel 7.15 Released

The Laravel team released v7.15.0 with a test assistant, a new model method to define relationships between models.

Expandable Relationships for Models

Gergő D. NagyresolveRelationUsing a method that enables defining relationships between models from outside model class definitions AddDi:

Order::resolveRelationUsing('customer', function ($model) {
return $model->belongsTo(Customer::class, 'customer_id');

WithToken (Test Assistant)

Aryeh RaberwithToken() HTTP contributed to the test assistant:

Using withHeader
$response = $this->withHeader('Authorization', 'Bearer test_token')->postJson('/some-endpoint');
// The new withToken () helper
$response = $this->withToken('test_token')-postJson('/some-endpoint');

Foreign UUID

Paul AdamsforeignUuid() contributed to the definition of a column for UUID foreign keys. Here are some examples of tests of pick request:


Release notes

Below you can see the full list of new features and updates and the difference between 7.14.0 and 7.15.0 on GitHub.



  • Added expandable relationships for models ( #33025 )
  • Illuminate\Foundation\Testing\Concerns\MakesHttpRequests::withToken()# 33075 , 79383a1 )
  • Illuminate\Database\Eloquent\Relations\HasOneOrMany::makeMany()(creating a large number without saving) ( # 33021 )
  • Illuminate\Database\Schema\Blueprint::foreignUuid()# 33129 )
  • Event handler queue viaQueue()to be set up by method ( # 32770 , 852a927 )


  • Model::withoutEvents()Fixed an issue where listeners were not booted and saved into () ( # 33149 , 4bb32ae )

Share this article

Comments (0)