Field Manual PHP / Laravel reference
← HTTP / API

REST

REST-style interfaces use resource URLs and HTTP semantics.

What it is

REST-style interfaces use resource URLs and HTTP semantics.

When to use it

Keep a small API consistent without forcing every operation into CRUD.

Syntax

GET /orders
GET /orders/{id}
POST /orders
PATCH /orders/{id}

Example

// A business action can be explicit:
POST /orders/42/cancellations
// Use authorization, validation, and conflict checks.
// Return 409 if already settled and cancellation is disallowed.

Common mistakes

Avoid verb-heavy arbitrary RPC everywhere; do not expose raw database tables as the API contract.

Related topics

Browse HTTP / API