Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maldoinc/doctrine-filter
Quickly add advanced filtering and sorting capabilities to resources in APIs or Web apps that use Doctrine.
https://github.com/maldoinc/doctrine-filter
doctrine doctrine-orm rest rest-api symfony
Last synced: 14 days ago
JSON representation
Quickly add advanced filtering and sorting capabilities to resources in APIs or Web apps that use Doctrine.
- Host: GitHub
- URL: https://github.com/maldoinc/doctrine-filter
- Owner: maldoinc
- License: mit
- Created: 2021-01-22T21:58:44.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-21T10:41:51.000Z (7 months ago)
- Last Synced: 2024-10-25T16:56:33.272Z (20 days ago)
- Topics: doctrine, doctrine-orm, rest, rest-api, symfony
- Language: PHP
- Homepage:
- Size: 157 KB
- Stars: 57
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.MD
- License: LICENSE.MD
Awesome Lists containing this project
README
# doctrine-filter
Quickly add advanced filtering and sorting capabilities to any resource in your APIs or Web apps that use
Doctrine.[![License](http://poser.pugx.org/maldoinc/doctrine-filter/license)](https://packagist.org/packages/maldoinc/doctrine-filter)
[![PHP Version Require](http://poser.pugx.org/maldoinc/doctrine-filter/require/php)](https://packagist.org/packages/maldoinc/doctrine-filter)
[![Version](http://poser.pugx.org/maldoinc/doctrine-filter/version)](https://packagist.org/packages/maldoinc/doctrine-filter)
[![Unit tests](https://github.com/maldoinc/doctrine-filter/actions/workflows/tests.yml/badge.svg)](https://github.com/maldoinc/doctrine-filter)
[![Lint](https://github.com/maldoinc/doctrine-filter/actions/workflows/quality-tools.yml/badge.svg)](https://github.com/maldoinc/doctrine-filter)###### Requirements
* PHP >= 7.4
* Doctrine >= 2.0---
#### Examples
Products with a price range between 100 and 200
```http
GET /products?price[gte]=100&price[lte]=200
```Users with a birthday after 1 Jan 2000
```http
GET /users?birthday[gte]=2000-01-01
```Users with an email ending with gmail.com
```http
GET /users?email[ends_with]=gmail.com
```Customers whose subscription field is null
```http
GET /customers?subscription[is_null]
```Users ordered by their last name in descending order
```http
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```http
GET /todos?status[eq]=done&page=1&perPage=10&orderBy[id]=desc
```## Documentation
[Read the documentation here](docs/index.md)