Skip to content

Commit

Permalink
[13.x] Fix scope removal in nested where conditions (#54816)
Browse files Browse the repository at this point in the history
* Add tests

* Remove any scopes removed in a nested where

* Update tests to expect calls to `removedScopes`
  • Loading branch information
willrowe authored Feb 27, 2025
1 parent e87700a commit 745fd0b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'

$this->eagerLoad = array_merge($this->eagerLoad, $query->getEagerLoads());

$this->withoutGlobalScopes(
$query->removedScopes()
);
$this->query->addNestedWhereQuery($query->getQuery(), $boolean);
} else {
$this->query->where(...func_get_args());
Expand Down

0 comments on commit 745fd0b

Please sign in to comment.