-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Labels
enhancementNew feature or requestNew feature or request
Description
return AccessAddress::query()
->joinRelationship("contracts", fn($join) => $join->where("column", "someting"))
->count();
Doing this with belongsTomany relationship (contracts) will not fail, but the were sentence (column, something) will never be applied.
The docs does say you should do something like:
User::joinRelationship('groups', [
'groups' => [
'groups' => function ($join) {
// ...
},
// group_members is the intermediary table here
'group_members' => fn ($join) => $join->where('group_members.active', true),
]
]);
It would make sense to throw an error to prevent implementing it wrong
or make it if you use a callback it would use it like this underneed:
AccessAddress::query()->joinRelationship('contracts', [
'contracts' => fn($join) => $join->where("column", "someting"))
])->count();
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request