Endpoints overview

Control-table HTTP API routes

All HTTP endpoints are registered automatically by the package. You do not add these to your app's routes/api.php.

Base URL pattern

/{guard-prefix}/api-table/control-tables/{endpoint}/{tableName}/...

Example (typical Laravel API setup):

ConfigResulting base
guards => ['api']/api/api-table/control-tables/...
guards => ['api', 'web']API routes + /api-table/control-tables/... for web

Use php artisan route:list --name=ApiTables to see exact paths in your app.

Route reference

MethodPath suffixPurpose
GETload-table/{tableName}/{withData?}Structure (+ optional data)
POSTquery-table/{tableName}Paginated rows
POSTbulk-table-action/{tableName}/{action}Bulk action
POSTrow-table-action/{tableName}/{action}/{id}Single row action
POSTrow-bulk-table-action/{tableName}/{action}Row action × N ids
POSTrow-refetch/{tableName}/{rowId}Refresh one row
POSTmulti-row-refetch/{tableName}Refresh many rows

Route names: ApiTables.{guard}.loadTable, ApiTables.{guard}.queryTableData, etc.

Authentication

Every request passes through TablesMiddleware:

  1. default_middlewares from config (usually auth:sanctum)
  2. Per-table middlewares if defined
# All requests need a valid token by default
curl -H "Authorization: Bearer {token}" ...

Response envelope

Success:

{ "success": true, ...payload }

Failure (actions):

{
  "success": false,
  "errors": ["Action is not defined", "إجراء غير معرف"]
}

HTTP 422 for action errors. Auth failures use standard Laravel 401/403.

How frontend discovers URLs

Action URLs are embedded in structure JSON — the frontend does not construct them manually:

{
  "action_key": "archive",
  "action": {
    "api": "https://app.test/api/api-table/control-tables/row-table-action/users/archive"
  },
  "method": "post"
}

When you rename an action key, the frontend picks up the new URL on next structure load.

Testing tips

ToolUse for
curl / HTTPieQuick structure and query checks
Postman / InsomniaSave token, share collection with team
php artisan route:listVerify guard prefix
Browser network tabCompare with frontend team's requests

On this page