Closed mitchierichie closed 3 years ago
Why would it change the requested relationship name to camel case? Wouldn't you just use the exact relationship name provided by the developer, not modify it and then fail to find relationships?
This tried to follow 2 best practices: case insensitive urls & camelcase for Laravel relationships. Ultimately not the best choice for this package. Let's continue this issue in the #641
@AlexVanderbist I see, well I appreciate the quick turnaround
https://spatie.be/docs/laravel-query-builder/v3/features/filtering#exact-or-partial-filters-for-related-properties
Following the instructions in the link above, I tried to create an AllowedFilter for one of my relationships. My query fails because instead of filtering by my related model, it tries to find a column with that name on the main model's table.
I did some digging - seems Spatie\QueryBuilder\Filters\FiltersExact, L51 is responsible. I've included the source for that method here:
Why would it change the requested relationship name to camel case? Wouldn't you just use the exact relationship name provided by the developer, not modify it and then fail to find relationships?