#What would you consider to be the best way to filter Eloquent Models (without a package)?

4 messages · Page 1 of 1 (latest)

shy gulch
#

Well why can’t you install a package that solves your problem, instead of re-inventing the wheel?

#

Well hypothetically I’d just install Spatie’s package 🙃

craggy flicker
#

I use spaties package myself, but I wrote another decorator around it, so that I can easily set allowed filters/scopes via middleware. As Martin said, it is a well used package and I would prefer to not need to rewrite that same logic in every project I wanted to easily filter/sort via query params. To me, my dependency on the package is worth it as I both trust spaties track record, but also because it solves 85% of my needs out of the box without any friction.