cloudcreativity / laravel-json-api

JSON API (jsonapi.org) package for Laravel applications.
http://laravel-json-api.readthedocs.io/en/latest/
Apache License 2.0
778 stars 109 forks source link

Filters: equals versus like #599

Closed a-rsc closed 3 years ago

a-rsc commented 3 years ago

I'm wondering how to use the scopes filters. When do you use equals versus like? And in which type of dates?

lindyhopchris commented 3 years ago

This is completely down to your application and what filtering logic you'd like to implement. We don't provide any recommendations on how to implement filtering, because the JSON:API spec leaves it totally open for each application to decide how to do filtering. This is because it is driven by your use-case. All the spec defines is that the filter query parameter exists for filtering, so that is as much as we implement and give you the hooks to add your own filtering logic.

If you want to find out what other people do for filtering, it might be worth asking on Slack

Feel free to re-open the issue if you have a more specific question or problem implementing filters.