[9.x] Fix base query for relationships#41918
Conversation
|
We need to dig into why this method was changed for Laravel 9.x - there was likely a reason. |
|
The So, my guess is that this is not an intended change but simply an oversight in the implementation because with the query builder interface the |
|
@taylorotwell @driesvints In my opinion is the now merged fix is adding a new inconsistency. In Laravel v8 the implementation for public function getBaseQuery()
{
return $this->query->getQuery();
}With the new fix it's now the following which is different (it's now applying the scope!): public function getBaseQuery()
{
return $this->toBase();
}
public function toBase()
{
return $this->query->applyScopes()->getQuery();
} |
|
@tpetry ah right, can you send in a PR for that? |
|
Give me some minutes 😉 |
This PR fixes an issue where scopes (like soft deletes) weren't applied when the base query of a relationship was retrieved. Previously, in Laravel v8, this was still applied properly.
Fixes #41885