Skip to main content
This is an advanced Resource topic. Use it when your base endpoints work and you need better query behavior. Exo resources support searching via the ?search= query parameter on the list endpoint. You can also customize the base query to add eager loading, default ordering, or scopes. The quickest way to enable search is to list the columns you want to be searchable:
When a user requests GET /exo-api/resources/contact?search=jane, Exo runs an OR LIKE query across these columns, matching any record where name or email contains “jane”.

Custom search logic

For more control, override the applySearch method. This is useful for full-text search, searching across relationships, or other custom matching:
When you override applySearch, the searchableColumns return value is ignored — your custom method takes full control.

Customizing the base query

The baseQuery method defines the starting Eloquent query for all list and show operations. Override it to add eager loading, default scopes, or ordering:
If your transform method accesses relationships, eager-load them in baseQuery to avoid N+1 query problems.

Pagination

List endpoints return paginated results. The default page size is 15. API consumers can change it with the ?per_page= query parameter:
The response includes standard Laravel pagination metadata: