Merge pull request #4934 from k3rnel/patch-2

Fixed belongsToMany relations eager loading issue
This commit is contained in:
Jitendra Singh 2021-06-16 11:14:39 +05:30 committed by GitHub
commit bfde837124
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;
}
}
}