Tuner Docs

A Laravel package to fine-tune your APIs.

View on GitHub
📚 Documentation
🧪 Basic Features
🧪 Intermediate Features
🧪 Advanced Features

Filter (in[column])

The in-filter allows clients to request resources that match specific values for a column. You can also combine multiple columns using logical operators.



Filter by Multiple IDs

Request
GET /api/users?in[id]=1,2,3

Where id is the target column for filtering, and 1,2,3 are the specific values to match.

Query Parameters
Name Type Description
in[id] string Comma-separated list of IDs to include.
Response
[
  { "id": 1, "name": "...", ... },
  { "id": 2, "name": "...", ... },
  { "id": 3, "name": "...", ... }
]


Combine with AND Operator

Request
GET /api/users?in[id]=1,2,3&in[and status]=active,pending

Where id, status are the target columns for filtering, and is the logical operator, and 1,2,3, active,pending are the values to filter by.

Query Parameters
Name Type Description
in[id] string Match IDs 1, 2, 3
in[and status] string AND condition for matching users with status values
Response
[
  { "id": 1, "status": "active", ... },
  { "id": 2, "status": "pending", ... }
]


Combine with OR Operator

Request
GET /api/users?in[id]=1,2&in[or role]=admin,editor

Where id, role are the target columns for filtering, or is the logical operator, and 1,2, admin,editor are the acceptable values.

Query Parameters
Name Type Description
in[id] string Match IDs 1 or 2
in[or status] string OR condition for matching roles
Response
[
  { "id": 1, "role": "dev", ... },
  { "id": 2, "role": "qa", ... },
  { "id": 3, "role": "admin", ... },
  { "id": 4, "role": "editor", ... },
]


NOT AND Operator (and!)

Request
GET /api/users?in[id]=1,2,3&in[and! status]=banned

Where id, status are the target columns for filtering, and! is the logical operator with a negation effect, and 1,2,3, banned are the values to be excluded.

Query Parameters
Name Type Description
in[id] string Filter by specific IDs
in[and! created_at] string Exclude results where status is "banned" using NOT AND
Response
[
  { "id": 1, "status": "active", ... },
  { "id": 3, "status": "pending", ... }
]


NOT OR Operator (or!)

Request
GET /api/users?in[id]=1,2,3&in[or! role]=writer,guest

Where id, role are the target columns for filtering, or! is the logical operator with a negation effect, and 1,2,3, writer,guest are the values to be excluded.

Query Parameters
Name Type Description
in[id] string Filter by specific IDs
in[or! created_at] string Exclude if any role matches "writer" or "guest" using NOT OR logic
Response
[
  { "id": 1, "role": "guest", ... },
  { "id": 2, "role": "guest", ... },
  { "id": 3, "role": "writer", ... },
  { "id": 4, "role": "admin", ... }
]