maldoinc/doctrine-filter

Quickly add advanced filtering/searching and sorting capabilities to any resource in your APIs or Web apps that use Doctrine.

v2.0.0 2024-04-11 20:43 UTC

This package is auto-updated.

Last update: 2024-12-21 12:04:36 UTC


README

Quickly add advanced filtering and sorting capabilities to any resource in your APIs or Web apps that use Doctrine.

License PHP Version Require Version Unit tests Lint

Requirements
  • PHP >= 7.4
  • Doctrine >= 2.0

Examples

Products with a price range between 100 and 200

GET /products?price[gte]=100&price[lte]=200

Users with a birthday after 1 Jan 2000

GET /users?birthday[gte]=2000-01-01

Users with an email ending with gmail.com

GET /users?email[ends_with]=gmail.com

Customers whose subscription field is null

GET /customers?subscription[is_null]

Users ordered by their last name in descending order

GET /users?orderBy[lastName]=desc

For this query only the status filter and order by id desc will be applied. Any keys not in the specified filter or orderBy format will be ignored

GET /todos?status[eq]=done&page=1&perPage=10&orderBy[id]=desc

Documentation

Read the documentation here