Authorize
Decide whether the current user may apply a filter before it touches the query.
Turn request data into expressive, secure queries through four purpose-built engines—without scattering conditional logic across your application.
Each engine solves a different API shape. Start simple, go deeply relational, or accept complex boolean trees without rewriting your application layer.
Map request keys to focused PHP methods and enrich them with attributes.
?status=published&search=laravelExplore engine →Expose an explicit field/operator/value contract for predictable REST APIs.
?filter[views][gte]=100Explore engine →Filter direct and deeply nested Eloquent relations with clear allowlists.
?filter[author.name][like]=ahmedExplore engine →Translate nested AND/OR JSON trees into correctly grouped Eloquent queries.
{ "and": [{ "field": "status" }] }Explore engine →Every condition follows one visible lifecycle, so behavior stays testable as filtering grows.
See how the runtime works →Decide whether the current user may apply a filter before it touches the query.
Use familiar Laravel rules to reject malformed request data with useful errors.
Trim, cast, map, sanitize, or enrich values through a consistent Payload.
Generate direct or relational Eloquent constraints and record the outcome.
class PostFilter extends Filterable
{
protected $filters = ['status', 'search'];
#[Trim]
protected function search(Payload $payload): Builder
{
return $this->builder->where(
'title', 'like', $payload->asLike('both')
);
}
}Switch approaches without losing the package features around them. All engines share the same builder integration, operator pipeline, runtime context, and observability.
The surrounding tools are part of the package—not an afterthought you have to rebuild in every project.
Keep the field, resolved operator, transformed value, and raw input together across the entire lifecycle.
GuardrailsAuthorization, validation, sanitization, and explicit allowlists work before query application.
CachingMultiple strategies, scoped keys, tags, profiles, and automatic invalidation.
Events & profilerInspect applied and skipped payloads, subscribe to lifecycle events, and profile execution.
Set up, generate, discover, inspect, list, and test filters without leaving the terminal.
Download the official package instructions so AI tools use the current APIs, choose the right engine, and avoid legacy patterns.