Open nhatkha1407 opened 11 months ago
hello, glad that purity helped you. purity at it core uses laravels whereHas (laravel docs) function to filter by relations. try whereHas function outside purity and see if it works. you probably need to redefine the belongsToMany relation.
What do you think if we manual add table name inside whereHas
I tried implementing this in the EqualFilter.php
file and it seems to work well. Adding the table name provides more clarity in the query and ensures we are filtering on the correct table.
Modified:
foreach ($this->values as $value) {
$query->where($query->from . '.' . $this->column, $value);
}
Let me know if you have any other thoughts!
First of all, thank you to the author and contributors for creating this useful package!
I ran into the following error when using the package:
Endpoint:
Post.php
Error:
The query needs to disambiguate the ambiguous id column reference.
I'm happy to provide any other details that would be helpful.
Again, thanks for your work on this package!