PHPackages                             byjg/restserver - 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. byjg/restserver

ActiveLibrary[API Development](/categories/api)

byjg/restserver
===============

Create RESTFull services with different and customizable output handlers (JSON, XML, Html, etc.). Auto-Generate routes from swagger.json definition.

6.0.0(5mo ago)449.3k↓46%37MITPHPPHP &gt;=8.3 &lt;8.6CI passing

Since Aug 1Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/byjg/php-restserver)[ Packagist](https://packagist.org/packages/byjg/restserver)[ GitHub Sponsors](https://github.com/byjg)[ RSS](/packages/byjg-restserver/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (33)Used By (7)

   sidebar\_key restserver   tags    php

 http

    Rest Server
===========

[](#rest-server)

Create RESTFull services with different and customizable output handlers (JSON, XML, Html, etc.). Auto-Generate routes from swagger.json definition.

[![Sponsor](https://camo.githubusercontent.com/fab14b7f7f475072ada0473f193d6f322561fd4a2958e0cc89910d053347cf27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d2532336561346161613f6c6f676f3d67697468756273706f6e736f7273266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d306431313137)](https://github.com/sponsors/byjg)[![Build Status](https://github.com/byjg/php-restserver/actions/workflows/phpunit.yml/badge.svg?branch=master)](https://github.com/byjg/php-restserver/actions/workflows/phpunit.yml)[![Opensource ByJG](https://camo.githubusercontent.com/425c1bbccc0f292bf4d20569ae74a6b2e384fd648f1af8911bc61de9a8dcfc0b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6f70656e736f757263652d62796a672d737563636573732e737667)](http://opensource.byjg.com)[![GitHub source](https://camo.githubusercontent.com/88e61eb211719144efdd570290a0456b6e13099c2df8d973f1bb43fe33bf0039/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4769746875622d736f757263652d696e666f726d6174696f6e616c3f6c6f676f3d676974687562)](https://github.com/byjg/php-restserver/)[![GitHub license](https://camo.githubusercontent.com/281094601ac2b3ab83b5cc34f519f3e458c68739f2ec1072d6bead8b51c742fd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f62796a672f7068702d726573747365727665722e737667)](https://opensource.byjg.com/opensource/licensing.html)[![GitHub release](https://camo.githubusercontent.com/2f008c39643b9f7c9e0eaee6ef090ce3c21c697a0eb729837513f0591dd543c1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f62796a672f7068702d726573747365727665722e737667)](https://github.com/byjg/php-restserver/releases/)

Documentation
-------------

[](#documentation)

Setup:

- [Set up the RestServer](docs/setup.md)

Creating and customizing routes:

- [Defining Route Names](docs/defining-route-names.md)
- [Create Routes using Closures](docs/routes-using-closures.md)
- [Create Routes Manually](docs/routes-manually.md)
- [Create Routes using PHP Attributes](docs/routes-using-php-attributes.md)
- [Auto-Generate from an OpenApi definition](docs/autogenerator-routes-openapi.md) (**hot**)

Processing the request and output the response:

- [HttpRequest and HttpResponse object](docs/httprequest-httpresponse.md)
- [File Uploads](docs/file-uploads.md)

Advanced:

- [Middleware](docs/middleware.md)
    - [CORS Support](docs/middleware-cors.md)
    - [Static Server Files](docs/middleware-staticserver.md)
    - [JWT Authentication](docs/middleware-jwt.md)
- [Error Handler](docs/error-handler.md)
- [Intercepting the Request](docs/intercepting-request.md)
- [Output Processors](docs/outprocessor.md)
- [Caching Routes](docs/caching-routes.md)

Additional topics:

- [Mock Testing](docs/mock-testing.md)
- [Route Metadata](docs/route-metadata.md)
- [Content Negotiation](docs/content-negotiation.md)
- [Custom HTTP Status Codes](docs/custom-status-codes.md)
- [CSV Endpoint Example](docs/csv-endpoint-example.md)
- [PSR-7 Adapters](docs/psr7-adapters.md)

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

[](#installation)

```
composer require "byjg/restserver"
```

Dependencies
------------

[](#dependencies)

 ```
flowchart TD
    byjg/restserver --> byjg/serializer
    byjg/restserver --> byjg/singleton-pattern
    byjg/restserver --> byjg/cache-engine
    byjg/restserver --> byjg/webrequest
    byjg/restserver --> byjg/jwt-wrapper
```

      Loading ---

[Open source ByJG](http://opensource.byjg.com)

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance79

Regular maintenance activity

Popularity34

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity92

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98.5% 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 ~121 days

Recently: every ~85 days

Total

32

Last Release

175d ago

Major Versions

1.1.1 → 2.0.02016-05-12

2.1.3 → 3.0.02018-01-30

3.1.1 → 4.0.02020-07-05

4.9.4 → 5.0.02024-10-29

5.0.3 → 6.0.02025-11-24

PHP version history (5 changes)1.0.0PHP &gt;=5.4.0

3.0.0PHP &gt;=5.6.0

4.9.1PHP &gt;=7.4

5.0.0PHP &gt;=8.1 &lt;8.4

6.0.0PHP &gt;=8.3 &lt;8.6

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/981924?v=4)[Joao Gilberto Magalhaes](/maintainers/byjg)[@byjg](https://github.com/byjg)

---

Top Contributors

[![byjg](https://avatars.githubusercontent.com/u/981924?v=4)](https://github.com/byjg "byjg (325 commits)")[![cdenadai](https://avatars.githubusercontent.com/u/51721735?v=4)](https://github.com/cdenadai "cdenadai (3 commits)")[![leonardomunsa](https://avatars.githubusercontent.com/u/61881081?v=4)](https://github.com/leonardomunsa "leonardomunsa (2 commits)")

---

Tags

phprestfulswagger

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/byjg-restserver/health.svg)

```
[![Health](https://phpackages.com/badges/byjg-restserver/health.svg)](https://phpackages.com/packages/byjg-restserver)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[kbsali/redmine-api

Redmine API client

4221.1M24](/packages/kbsali-redmine-api)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[bushlanov-dev/max-bot-api-client-php

Max Bot API Client library

281.6k](/packages/bushlanov-dev-max-bot-api-client-php)

PHPackages © 2026

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