PHPackages                             innmind/rest-server - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. innmind/rest-server

AbandonedArchivedLibrary[HTTP &amp; Networking](/categories/http)

innmind/rest-server
===================

Library to easily expose REST APIs

8.1.0(5y ago)224.8k4MITPHPPHP ~7.4|~8.0

Since Sep 3Pushed 5y ago2 watchersCompare

[ Source](https://github.com/Innmind/rest-server)[ Packagist](https://packagist.org/packages/innmind/rest-server)[ Docs](http://github.com/Innmind/rest-server)[ RSS](/packages/innmind-rest-server/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (12)Versions (32)Used By (4)

REST Server
===========

[](#rest-server)

[![Build Status](https://github.com/Innmind/rest-server/workflows/CI/badge.svg?branch=master)](https://github.com/Innmind/rest-server/actions?query=workflow%3ACI)[![codecov](https://camo.githubusercontent.com/596e0f4bbb8f43ce2def3fba586f3fe293b14f0342feb0934438175e1cbfada8/68747470733a2f2f636f6465636f762e696f2f67682f496e6e6d696e642f726573742d7365727665722f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/Innmind/rest-server)[![Type Coverage](https://camo.githubusercontent.com/52234e4414bcbecf831b0423c83ae7aac84f5b7da656ec25c746cb200e7065ea/68747470733a2f2f73686570686572642e6465762f6769746875622f496e6e6d696e642f726573742d7365727665722f636f7665726167652e737667)](https://shepherd.dev/github/Innmind/rest-server)

This library contains a set of tools to define, validate, extract and expose resources through http in a REST manner.

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

[](#installation)

Via composer:

```
composer require innmind/rest-server
```

Usage
-----

[](#usage)

```
use function Innmind\Rest\Server\bootstrap;
use Innmind\Rest\Server\Gateway;
use Innmind\Immutable\Map;

$services = bootstrap(
    new Map('string', Gateway::class),
    require '/path/to/resources/mapping.php'
);

$services['routes']; // provides all the routes available for the definitions you provided

// action controllers
$services['controller']['create'];
$services['controller']['index'];
$services['controller']['get'];
$services['controller']['remove'];
$services['controller']['update'];
$services['controller']['link'];
$services['controller']['unlink'];
// controller to output the resource definition
$services['controller']['options'];
// controller to expose links to all the resources definitions
$services['controller']['capabilities'];
```

The gateways are the bridges between this component and your domain. The definition handling which resource is handled by which gateway is done in the resources mapping where a resource can only be managed by one gateway. Take a look at [`fixtures/mapping.php`](fixtures/mapping.php) to understand how to define your resources.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~73 days

Recently: every ~223 days

Total

28

Last Release

1920d ago

Major Versions

3.1.3 → 4.0.02017-02-27

4.0.0 → 5.0.02017-09-28

5.0.0 → 6.0.02018-08-27

6.1.1 → 7.0.02019-01-11

7.0.0 → 8.0.02020-03-15

PHP version history (6 changes)1.0.0PHP &gt;=5.5

3.0.0PHP ~7.0

4.0.0PHP ~7.1

6.0.0PHP ~7.2

8.0.0PHP ~7.4

8.1.0PHP ~7.4|~8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (476 commits)")

---

Tags

apirest

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/innmind-rest-server/health.svg)

```
[![Health](https://phpackages.com/badges/innmind-rest-server/health.svg)](https://phpackages.com/packages/innmind-rest-server)
```

###  Alternatives

[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k48.1M236](/packages/api-platform-core)[api-platform/symfony

Symfony API Platform integration

323.2M67](/packages/api-platform-symfony)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[mezzio/mezzio-problem-details

Problem Details for PSR-7 HTTP APIs addressing the RFC 7807 standard

271.1M24](/packages/mezzio-mezzio-problem-details)[phrest/api

REST API Package for Phalcon PHP

304.2k](/packages/phrest-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
