All projects

Open-source project

Filterable

Enhance Laravel queries with adaptable, customisable filters and intelligent caching to improve both performance and functionality.

195 stars10 forksPHP

About the project

Filterable turns HTTP request parameters into explicit, reusable Eloquent query filters. Declare handlers with attributes or existing properties, then opt into validation, transformations, permissions, caching, complexity limits, logging, optimization, streaming, and query chaining.

This README is the complete usage guide. Examples below use an application Post model with ordinary fields such as title , body , status , price , is available , published at , and tenant id ; adapt those names and relationships to your schema.

Registering filters: attributes, properties, and aliases

Problem

Filtering logic in Laravel applications can become repetitive, scattered, and difficult to test as APIs and dashboards grow.

Architecture

A Laravel-focused package that organizes request-driven filtering into explicit, reusable query behavior.

Design decisions

  • Move filtering behavior into reusable structures that keep controllers and query surfaces clean.
  • Support practical product query patterns without turning the package into an opaque query language.
  • Optimize for maintainability in data-heavy application code.

Constraints and lessons

Constraints

  • The package needs to fit Laravel conventions rather than fight them.
  • Flexibility has to be balanced against clear behavior and readable implementation.

Lessons

  • Reusable application patterns should remove repetition without hiding business intent.
  • Framework packages succeed when they feel native to the framework's existing habits.

Maintained as a Laravel package with ongoing public usage.