I want to search a team, and join to the result the users who are part of this team, and amongst these users, those who have the value 'left_at' at NULL on the pivot table. Here is my payload:
It seems that the filter on the pivot table is not working at all, or that I misunderstood the way it works.
I've found a way around using a scope, but it would be nice to have it filter properly.
Steps To Reproduce
Make a search request on a model with a many-to-many relationship, inluding the relationship and filtering on a data on the pivot table.
Laravel Rest Api Version
2.8.7
Laravel Version
11
PHP Version
8.3
Database Driver & Version
No response
Description
Considering the following example:
I want to search a team, and join to the result the users who are part of this team, and amongst these users, those who have the value 'left_at' at NULL on the pivot table. Here is my payload:
For my tests I've filtered on the object and its relation independently, as well as on both.
However in any case I get results where 'left_at' is not null.
It seems that the filter on the pivot table is not working at all, or that I misunderstood the way it works. I've found a way around using a scope, but it would be nice to have it filter properly.
Steps To Reproduce
Make a search request on a model with a many-to-many relationship, inluding the relationship and filtering on a data on the pivot table.