Download the PHP package mohamedfathy/dynamic-filters without Composer

On this page you can find all versions of the php package mohamedfathy/dynamic-filters. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dynamic-filters

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

Filter a query based on a request:

Example Request

SQL:

Adding Filters to the Product Model

Usage in Controller:


🛠 Installation

Install via Composer:


📌 List of Available Operators

Below are the available operators you can use in filtering:

Operator SQL Equivalent Description Example Usage
eq = Equal to filters[status:eq]=active
neq != Not equal to filters[status:neq]=active
gt > Greater than filters[price:gt]=100
lt < Less than filters[price:lt]=1000
gte >= Greater than or equal filters[rating:gte]=4
lte <= Less than or equal filters[discount:lte]=50
like LIKE Partial match filters[name:like]=car
nLike NOT LIKE Does not match pattern filters[name:nLike]=tablet
null IS NULL Field is null filters[deleted_at:null]
nNull IS NOT NULL Field is not null filters[updated_at:nNull]
in IN Value in list filters[status:in]=active,pending
nIn NOT IN Value not in list filters[status:nIn]=banned
between BETWEEN Value in range filters[price:between]=100,500
nBetween NOT BETWEEN Value outside range filters[age:nBetween]=18,60
regexp REGEXP Matches regex pattern filters[sku:regexp]=^[A-Z]+
nRegexp NOT REGEXP Does not match regex pattern filters[code:nRegexp]=[0-9]+

🔍 Query Examples

✅ Standard Filtering

Request:

SQL:


✅ Multiple Filters

Request:

SQL:


✅ Sorting

Request:

SQL:


✅ Pagination

Request:

SQL:


✅ Filtering by Relationship

Request:

SQL:


✅ Custom Filter Example

Request:

SQL:

🔧 Why Use Custom Filters?

By default, standard filters and relation filters cover most scenarios. However, in some cases, you may need more flexibility.
For example, if your filtering logic involves complex conditions, multiple values, or custom operations, it's best to create a dedicated Filter Class
for each model and handle all related filters inside it.


How to Create Custom Filters

Create a Filter Class for Each Model

Instead of writing filtering logic inside controllers or query scopes, you should create a dedicated filter class for each model.
For example, let's create a ProductFilters class that handles filtering for the Product model.


✅ Conclusion


📌 Need Help?

Feel free to contribute or raise an issue if you have suggestions! 🚀


All versions of dynamic-filters with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mohamedfathy/dynamic-filters contains the following files

Loading the files please wait ...