PHPackages                             phpnomad/rest - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. phpnomad/rest

ActiveLibrary[API Development](/categories/api)

phpnomad/rest
=============

2.0.5(3w ago)05.6k↓15.7%[1 issues](https://github.com/phpnomad/rest/issues)[5 PRs](https://github.com/phpnomad/rest/pulls)6MITPHPCI passing

Since Jun 2Pushed 2w ago2 watchersCompare

[ Source](https://github.com/phpnomad/rest)[ Packagist](https://packagist.org/packages/phpnomad/rest)[ Docs](https://github.com/phpnomad/core)[ RSS](/packages/phpnomad-rest/feed)WikiDiscussions main Synced yesterday

READMEChangelog (7)Dependencies (14)Versions (21)Used By (6)

phpnomad/rest
=============

[](#phpnomadrest)

[![Latest Version](https://camo.githubusercontent.com/8bf11ffbdd927e61882bcf5f79b2ea50ad74949ef140129b9d806a50657b0789/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e6f6d61642f726573742e737667)](https://packagist.org/packages/phpnomad/rest)[![Total Downloads](https://camo.githubusercontent.com/2e6d7ea99c297d61c035a8198f868c3fc6024dfdd810b4d2fe47a6e85b41eab0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7068706e6f6d61642f726573742e737667)](https://packagist.org/packages/phpnomad/rest)[![PHP Version](https://camo.githubusercontent.com/5482c5bd2761143e227b1e8295aa5e807dd1b3fb15e4b0046e2bc695b428b071/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7068706e6f6d61642f726573742e737667)](https://packagist.org/packages/phpnomad/rest)[![License](https://camo.githubusercontent.com/32443f81aff3efde48f6f74cd19c62b8adecd36cd0b75d52beed7a744f6b5265/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7068706e6f6d61642f726573742e737667)](https://packagist.org/packages/phpnomad/rest)

`phpnomad/rest` is an MVC-driven framework for defining REST APIs in a way that stays agnostic to the runtime you plug into. Controllers hold the business logic, `RestStrategy` implementations wire them into a host router (FastRoute, WordPress, or something custom), middleware shapes the request before your logic runs, validations enforce input contracts, and interceptors handle post-response side effects like events and logging. By separating API definition (what an endpoint is, what it requires, what it returns) from integration (how it runs inside a host), you get REST endpoints that move between stacks without rewrites.

The package runs in production behind the REST layer of [Siren](https://sirenaffiliates.com) and several MCP servers and client systems.

Installation
------------

[](#installation)

```
composer require phpnomad/rest
```

Quick Start
-----------

[](#quick-start)

A controller is a class that implements `PHPNomad\Rest\Interfaces\Controller`. Three methods describe the endpoint, and the container injects whatever services the constructor declares.

```
