I have a basic CRUD endpoint, and I want to be able to search by arbitrary fields in my database. Is there a way to allow this without specifying every possible filter in the method signature?
I ended up solving this by using the built in $_GET[] super global.
I would just use query parameters to solve this. So just accept the fields like example.com/api/people/?name=John&age=20
If you don't need to document them, you can use $request_data as a parameter, this will get all the data that is sent to the API