marcelgwerder / laravel-api-handler

Package providing helper functions for a Laravel REST-API
Other
152 stars 45 forks source link

Filter min and null combined #14

Open priithansen opened 9 years ago

priithansen commented 9 years ago

Stumbled upon a usercase where I would have to make an comparison on a nullable datetime field ended_at-min OR null.

Wonder if there is any way to make that possible?

priithansen commented 9 years ago

Don't know if it makes sense but maybe having col_name-or-min/max/.. properties supported for parameter grouping would be a good idea.

marcelgwerder commented 9 years ago

Not possible at the moment. Currently thinking about or-col_name-min, so adding it as a prefix and leaving the default as AND. I may rewrite the package though and this may not be added until then. Sorry for the late reply.

priithansen commented 9 years ago

Thanks for the relply. I thus far worked around this with a dirty request parameter comparison and query fix in controller.

or- prefix sounds like a great idea. Thanks for the package it has been a great help implementing flexible apis while keeping the code dry :+1: