spatie / laravel-query-builder

Easily build Eloquent queries from API requests
https://spatie.be/docs/laravel-query-builder
MIT License
4.06k stars 397 forks source link

Use exact relationship provided by developer #641

Closed mitchierichie closed 3 years ago

mitchierichie commented 3 years ago

Changing the relationship method name provided by the developer to camel case is bad practice. This is also undocumented and unexpected behavior and quite frustrating as a developer using this package. The name of the filter is exact - it should be exact.

mitchierichie commented 3 years ago

Fixes #640

mitchierichie commented 3 years ago

@AlexVanderbist I think I missed a few places where the camel case conversion comes in but hopefully my idea is clear. I will try to update this PR soon with a full fix for my mentioned issue #640 but I don't know this codebase in and out...

should I close this PR until I can add more commits?

AlexVanderbist commented 3 years ago

Thanks, we've been pushing back this change for a while because it's a breaking change. I'll merge this into master, go over the rest of the package and tag v4 of the package later today :)

AlexVanderbist commented 3 years ago

I've prepared the rest of the package to no longer camel-case any values for filters, includes and fields. It's available on the master branch and using composer require spatie/laravel-query-builder@dev-master. I'll update the docs later before tagging v4

mitchierichie commented 3 years ago

@AlexVanderbist thank you!