Fixed belongsToMany relations eager loading issue

This commit is contained in:
Poghos Boyajyan 2021-06-15 17:30:08 +04:00 committed by GitHub
parent 2336790ffc
commit 9bc38e631f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -321,7 +321,7 @@ class Product extends Model implements ProductContract
public function getAttribute($key)
{
if (! method_exists(static::class, $key)
&& ! in_array($key, ['parent_id', 'attribute_family_id'])
&& ! in_array($key, ['pivot', 'parent_id', 'attribute_family_id'])
&& ! isset($this->attributes[$key])
) {
if (isset($this->id)) {
@ -438,4 +438,4 @@ class Product extends Model implements ProductContract
{
return $this;
}
}
}