Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filterable Laravel Package

heroicpixels/filterable

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Self-service analytics/data exploration: Enable non-technical users (e.g., sales, support) to filter datasets via URL parameters without backend changes.
  • API-driven filtering: Standardize filtering logic across frontend frameworks (React, Vue, etc.) by exposing Eloquent queries via filtered API endpoints.
  • Roadmap prioritization: Accelerate MVP development for search/filter-heavy features (e.g., e-commerce product grids, CRM lead pipelines).
  • Build vs. buy: Avoid reinventing query parsing logic for common use cases (e.g., ?status=active&price__gt=100).
  • Use cases:
    • Public-facing search (e.g., job boards, real estate listings).
    • Internal dashboards with URL-shareable views.
    • A/B testing variants (filter by experiment_group).
    • Compliance reporting (filter by created_at ranges).

When to Consider This Package

  • Adopt if:

    • Your app uses Eloquent and needs dynamic URL-based filtering with minimal backend code.
    • You prioritize developer velocity over fine-grained control (e.g., custom SQL for complex joins).
    • Your filtering logic is predictable (e.g., simple =, >, <, in operations).
    • You’re okay with MIT license and open-source dependencies.
  • Look elsewhere if:

    • You need multi-table joins or aggregations (consider Laravel Scout or custom scopes).
    • Your filters require full-text search (use Laravel Scout + Algolia/Meilisearch).
    • You’re using raw SQL queries or non-Eloquent models.
    • You need real-time filtering (e.g., WebSockets; this is for HTTP requests).
    • Your team lacks PHP/Laravel expertise (steepness of Eloquent + package integration).

How to Pitch It (Stakeholders)

For Executives: "This package lets us ship search/filter features 10x faster by automatically parsing URL parameters (e.g., ?status=active&price__lt=500) into database queries—no backend changes needed. It’s like giving our users a ‘Google for our data’ without custom dev work. Ideal for MVPs, public APIs, or internal tools where URL-shareable views add value. MIT-licensed and battle-tested since 2014."

For Engineers: *"Filterable turns ?category=electronics&in_stock=true into a clean Eloquent query with zero manual where() clauses. Key benefits:

  • Traits/Wrapper: Plugs into models or wraps queries dynamically.
  • Operators: Supports =, >, <, in, like, etc., out of the box.
  • Validation: Auto-sanitizes inputs (prevents SQL injection via Eloquent).
  • Extensible: Override defaults for custom logic. Tradeoff: Best for simple filters; complex use cases may need custom scopes. Example:*
// Model: Product.php
use Heroicpixels\Filterable\FilterableTrait;
class Product extends Model {
    use FilterableTrait;
    protected $filterable = ['category', 'price', 'in_stock'];
}

Now /products?category=books&price__gt=20 works automatically."

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
roundly-consulting/kubernetes-api-for-laravel
roundly-consulting/plausible-for-laravel
gvp/gvp-laravel-template
metasyncsite/laravel-metasync-client
roundly-consulting/onboarding-for-laravel
andydefer/laravel-notification
adachsoft/cli-process-tester
jhaskell13/laraflow
sebastienheyd/boilerplate-media-manager
ccast/tagixo-primix
pretendtrue/laravel-builder
sawmainek/laravel-scout-tntsearch-driver
tomshaw/laravel-calendar-table
dibakar/laravel-ownership
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo