You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@phroggyy your clone $this->query in the #13724 and some update in the #13737 still has some bugs related with global scopes.
In my project we create a global scopes in Model X and Model X has a MorphTo relation inside it :
class X extends Model
{
protected static function boot()
{
parent::boot();
static::addGlobalScope('x', function($builder) {
$builder->where('x', true);
});
}
public function morph()
{
return $this->morphTo();
}
}
When we load the relation 'morph' what happens is that our Global Scope 'x' is included because it clone the query and still has the previous global scopes inside it.
the $query still has the previous scopes set in model 'X'.
What is the purpose of cloning the query?
The problem isn't occurred in the 5.3.3 because it will use newQuery from the $instance.
The text was updated successfully, but these errors were encountered:
@phroggyy your clone $this->query in the #13724 and some update in the #13737 still has some bugs related with global scopes.
In my project we create a global scopes in Model X and Model X has a MorphTo relation inside it :
When we load the relation 'morph' what happens is that our Global Scope 'x' is included because it clone the query and still has the previous global scopes inside it.
the $query still has the previous scopes set in model 'X'.
What is the purpose of cloning the query?
The problem isn't occurred in the 5.3.3 because it will use newQuery from the $instance.
The text was updated successfully, but these errors were encountered: