PHPackages                             mohamedfathy/dynamic-filters - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mohamedfathy/dynamic-filters

ActiveLibrary

mohamedfathy/dynamic-filters
============================

A Laravel package that provides dynamic filtering, sorting, and relationship-based querying for Eloquent models.

v1.0.0(1y ago)019MITPHPPHP &gt;=8.0

Since Feb 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/mohamedfathy244633/dynamic-filters)[ Packagist](https://packagist.org/packages/mohamedfathy/dynamic-filters)[ RSS](/packages/mohamedfathy-dynamic-filters/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Dynamic API Query Filters for Laravel Applications
==================================================

[](#dynamic-api-query-filters-for-laravel-applications)

A **lightweight and flexible** query filtering package for Laravel, supporting **standard filters, relationship filters, and custom filters** via URL parameters. It enables **sorting and pagination** effortlessly while keeping query logic clean and maintainable. With intuitive syntax and extendability, it simplifies API request handling for scalable applications.

---

🚀 Basic Usage
=============

[](#-basic-usage)

Filter a query based on a request:

Example Request
---------------

[](#example-request)

```
GET /products?filters[category:eq]=electronics
```

SQL:
----

[](#sql)

```
SELECT * FROM products WHERE category = 'Electronics';
```

Adding Filters to the `Product` Model
-------------------------------------

[](#adding-filters-to-the-product-model)

```
