abbasudo/laravel-purity
Laravel Purity adds elegant filtering and sorting to Eloquent queries. Just call filter() on a model query, then let clients apply complex conditions via URL query parameters (e.g., filters[title][$contains]=...). Great for clean, flexible APIs.
where() clauses with a single filter() call).filters[status][$in]=active,published). Critical for:
category, price_range, or availability (e.g., filters[price][$between]=50,200).role, last_login).filters[revenue][$gt]=1000&sort=-created_at).where() clauses across controllers). Supports:
created_at?").?filters[tag]=laravel).Adopt if:
if-else block in controllers).LIKE/BETWEEN logic).Look elsewhere if:
has() → Extend the package or build custom scopes.Alternatives to Evaluate:
*"Laravel Purity lets us ship filtering/sorting features in days instead of weeks—without hiring more backend engineers. For example:
*"This package replaces repetitive where() logic with a declarative filter() call. Key wins:
if ($request->has('filters')) { ... } blocks.filters[status][$in]=active,published) so React/Vue teams can build UIs without spec reviews.wire:model.live for real-time filtering.Resolve class or add a one-liner.
Trade-offs:*"This lets you build search/filter UIs without backend blockers. How it works:
?filters[price][$gt]=50&sort=-created_at.?filters[status]=published. No backend tickets required.
Ask: Can we standardize on this for [Project X]? It’ll cut our API dependency delays by 50%."*How can I help you explore Laravel packages today?