Laravel 7.15 Out

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

Extensible Relationships for Models

Gergő D. NagyresolveRelationUsing is a method for defining relationships between models outside of model class definitions addDi:

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

WithToken () Test Assistant

Aryeh RaberwithToken() Contributed to the HTTP 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 the tests for the pick request:

$table->foreignUuid('company_id')->constrained();
$table->foreignUuid('laravel_idea_id')->constrained();
$table->foreignUuid('team_id')->references('id')->on('teams');
$table->foreignUuid('team_column_id')->constrained('teams');

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.

v7.15.0

Added

  • 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()method ( # 32770 , 852a927 )

constant

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

  Quote

KARABAY A, 2020 . Laravel 7.15 Out,

https://www.karabayyazilim.com/blog/php/framework/laravel/laravel-715-cikti-2020-06-11-164417

(Accessed June 11, 2020).


  Share this post

Comments (0)

Comment

Subscribe
Sign up for the email newsletter to be the first to know about my blog posts