abbasudo/laravel-purity
Laravel Purity adds elegant filtering and sorting to Eloquent queries via a simple filter() method. Let frontend users drive complex query conditions using URL query string parameters (e.g., filters[title][$contains]=Purity), with minimal boilerplate.
QueryBuilder) if they lack relation support or Livewire integration.qs library) to leverage Purity’s query syntax.?filters[price][$gt]=100), SaaS (e.g., ?filters[status][$eq]=active).?filters[created_at][$between]=2023-01-01,2023-12-31).Adopt if:
?filters[user.name][$contains]=John) without writing custom joins.qs library) over GraphQL-style inputs.Look elsewhere if:
WHERE date BETWEEN NOW() - INTERVAL '7 days' AND NOW()).spatie/laravel-graphql).For Executives:
"Laravel Purity lets our frontend and backend teams move faster by standardizing how users filter and sort data—whether in APIs, admin dashboards, or public tools. For example, a sales team could search orders by ?filters[customer.name][$contains]=Acme&sort[0]=created_at:desc without backend changes. It’s like adding ‘Ctrl+F’ to every database query, reducing dev time by 30% on features like search, reporting, or user dashboards. The MIT license and active maintenance make it a low-risk bet."
For Engineering Leads: *"This package replaces ad-hoc filter logic in controllers with a declarative, trait-based approach. Key wins:
Transaction::filter($this->filters)).?filters[user.role][$eq]=admin) without manual joins.qs library) to interact with APIs.For Developers: *"Swap this:
// Before: Manual filtering in controller
if ($request->has('min_price')) {
$query->where('price', '>=', $request->min_price);
}
For this:
// After: One line in model
$posts = Post::filter()->get(); // Handles ?filters[price][$gte]=100
if spaghetti in controllers. Works with Livewire, APIs, and relations.How can I help you explore Laravel packages today?