kettasoft/filterable
Filterable brings clean, request-driven filtering to Laravel Eloquent models. Define reusable filter classes, apply them to any query with a simple trait, and support search, sorting, and custom filters without bloating your controllers. Lightweight and easy to extend.
composer require kettasoft/filterable and publish the config (php artisan vendor:publish --tag=filterable-config) so the engine choice, mode, and allowed fields are visible in config/filterable.php.?filter[status]=active&filter[created_at][gte]=...) and the Tree engine only where the UI actually exposes nested groups. Don't pay Tree's complexity for a status dropdown.and/or boolean governs only its direct children, and nested groups keep their boundaries during recursive construction. This means a saved query-builder state can be serialized straight into a Tree payload without flattening or re-writing booleans — the mapping is now faithful.field/operator/value, and field/operator are in the model's whitelist. Reject unknown keys rather than letting them be silently ignored.AND parent containing an OR child, and the inverse) catch semantic regressions far better than asserting a toSql() string.and/or for its children. Most confusion around Tree payloads comes from conflating these; v3.0.1 makes the distinction real, so name your payload keys clearly.AND group is vacuously true; an empty OR group is false. Test both — they're the classic source of "filter returns everything" and "filter returns nothing" reports.toSql() + getBindings()) at the point the filter is applied, and cross-check binding order against your group nesting. Turning on the query log for a single request is usually faster than reasoning about the tree.php artisan config:cache (or config:clear locally) — mode changes appear to "not apply" otherwise.composer update kettasoft/filterable plus a re-run of your nested-group tests is sufficient. The only behavioral risk is code that depended on the old, incorrect group-join semantics.How can I help you explore Laravel packages today?