Data flow

Request and response flow for structure, query, and actions

This page shows exactly what travels over the wire in each phase. Use it when debugging with the network tab or coordinating with frontend developers.

Phase comparison

PhaseEndpointHTTPWho initiatesPayload size
Structureload-tableGETFrontend on page loadSmall (metadata)
Dataquery-tablePOSTFrontend on page/filter/sort changeMedium (one page of rows)
Actionrow-table-action, etc.POSTFrontend on button clickSmall

Structure load

When: User opens a page with a table.

Request:

GET /api/api-table/control-tables/load-table/users
Authorization: Bearer {token}

Optional: /load-table/users/true includes first page of data in the same response.

What the frontend does with this: Stores columns, filters, rowActions, bulkActions in Redux and renders the grid shell — headers, filter button, action toolbar — before any row data exists.


Query

When: Table mounts, user changes page, applies filter, or sorts a column.

Request:

POST /api/api-table/control-tables/query-table/users
Content-Type: application/json

{
  "filters": [{ "field": "name", "operator": "like", "value": "john" }],
  "sorts": [{ "field": "created_at", "direction": "desc" }],
  "page": 1,
  "perPage": 25,
  "params": { "warehouseId": "abc" }
}

params explained: Scoped context from the parent page (e.g. only orders for warehouse X). Merged from request body into table instantiation — use in setInitialBuilder() to add where clauses.

bindings explained: If your table implements bindings(), dynamic filter options (e.g. category dropdown values) are returned here so the frontend can refresh options without a separate API.


Row action

When: User clicks a row button (e.g. Archive).

Request:

POST /api/api-table/control-tables/row-table-action/users/archive/42

The URL is not invented by the frontend — it comes from action.api in the structure response.

onSuccess tells the frontend what to do next — refresh one row, reload the table, or show a modal. Set this on TableRowAction via ActionOnSuccessDo.


Bulk action

When: User selects rows and chooses Export or a custom bulk action.

POST /api/api-table/control-tables/bulk-table-action/users/export_excel

{
  "selected_ids": [1, 2, 3],
  "filters": []
}

If selected_ids is provided, the package merges an id IN (...) filter before running the export query.


Params passthrough (mid/senior)

Both load-table and query-table forward params:

// APITablesService merges request params
$params = array_merge($params, request()->input('params', []));
$table = new $tableConfig['tableClass']($user, $params);

Use this to scope tables without creating separate table names per context.


On this page