Tuner Docs

A Laravel package to fine-tune your APIs.

View on GitHub
πŸ“š Documentation
πŸ§ͺ Basic Features
πŸ§ͺ Intermediate Features
πŸ§ͺ Advanced Features

Search (search[column])

The searching feature allows clients to perform keyword-based searches across defined columns. It’s useful for implementing search bars or global search functionalities in applications.

You can use:



Both-Side Wildcard (*term*)

Request
GET /api/users?search[name]=*III*
Query Parameters
Name Type Description
search[column] string Wildcard pattern to search within a column.
Response
[
  {
    "id": 5,
    "name": "Dr. Cooper Blanda III",
    ...
  },
  {
    "id": 13,
    "name": "Dr. Tad Beer III",
    ...
  },
  {
    "id": 48,
    "name": "Mr. Kim Johnson III",
    ...
  }
]


Postfix Wildcard (term*)

Request
GET /api/users?search[name]=Dr*
Query Parameters
Name Type Description
search[column] string Match values starting with given term.
Response
[
  {
    "id": 5,
    "name": "Dr. Cooper Blanda III",
    ...
  },
  {
    "id": 13,
    "name": "Dr. Tad Beer III",
    ...
  }
]


Prefix Wildcard (*term)

Request
GET /api/users?search[email]=*org
Query Parameters
Name Type Description
search[column] string Match values ending with given term.
Response
[
  {
    "id": 2,
    "name": "Jairo Armstrong",
    "email": "damian83@example.org",
    ...
  },
  {
    "id": 4,
    "name": "Jacinthe Stamm",
    "email": "tmayert@example.org",
    ...
  }
]


You can chain multiple columns using search[column1,column2,columnN]=term for compound searches.