I have a few of these and generally use a variant of Simon's method where I
wrap everything in a custom class. I stash all the requirements/options in
the custom class instance, then invoke a `count()` or `paginated()` method
that builds/stashes the core query and runs `count()` or `all()` on
On Tue, Jan 2, 2018 at 11:59 PM, Nikola Jankovic wrote:
> I have an API endpoint that handles searches from the frontend. A search can
> have a dynamic amount of filters applied to it, including (1) sizes, (2)
> colors, (3) price, and (4) category that are passed through query
I have an API endpoint that handles searches from the frontend. A search
can have a dynamic amount of filters applied to it, including (1) sizes,
(2) colors, (3) price, and (4) category that are passed through query
parameters. Sizes and colors are passed as comma separated values (i.e.