Framework: Laravel 8 function setKeysForSaveQuery conflict

Created on 29 Sep 2020  路  3Comments  路  Source: laravel/framework


  • Laravel Version: 8.7.0
  • PHP Version: 7.4.6
  • Database Driver & Version: -

Description:

The problem is the function setKeysForSaveQuery($query).
In the file Iluminate\Database\Eloquent\Model.php is declared function setKeysForSaveQuery($query)
And in the file Iluminate\Database\Eloquent\Relations\Concerns\AsPivot.php is declared function setKeysForSaveQuery(Builder $query)

And both should declared identically for a correct performance.

Most helpful comment

Fixed on patch 8.7.1.

All 3 comments

Same here after upgrade to version 8.7.0:

[2020-09-29 17:33:31] demo.ERROR: Declaration of Illuminate\Database\Eloquent\Relations\Concerns\AsPivot::setKeysForSaveQuery(Illuminate\Database\Eloquent\Builder $query) should be compatible with Illuminate\Database\Eloquent\Model::setKeysForSaveQuery($query) {"exception":"[object] (ErrorException(code: 0): Declaration of Illuminate\\Database\\Eloquent\\Relations\\Concerns\\AsPivot::setKeysForSaveQuery(Illuminate\\Database\\Eloquent\\Builder $query) should be compatible with Illuminate\\Database\\Eloquent\\Model::setKeysForSaveQuery($query) at /www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/Pivot.php:91)

@taylorotwell related commit https://github.com/laravel/framework/commit/77db028225ccd6ec6bc3359f69482f2e4cc95faf

I have the same problem. Both methods does not have the same signature.

Illuminate\Database\Eloquent\Model::setKeysForSaveQuery($query)

Illuminate\Database\Eloquent\Relations\Concerns\AsPivot::setKeysForSaveQuery(Illuminate\Database\Eloquent\Builder $query)

Fixed on patch 8.7.1.

Was this page helpful?
0 / 5 - 0 ratings