PHPackages                             alexpts/psr15-next - 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. alexpts/psr15-next

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

alexpts/psr15-next
==================

Router for PSR-7 and PSR-15

0.5.0(5y ago)0189[1 PRs](https://github.com/alexpts/psr15-next/pulls)2MITPHPPHP ~8.0CI passing

Since Aug 25Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/alexpts/psr15-next)[ Packagist](https://packagist.org/packages/alexpts/psr15-next)[ Docs](https://github.com/alexpts/psr15-next)[ RSS](/packages/alexpts-psr15-next/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (8)Versions (20)Used By (2)

Next
====

[](#next)

[![phpunit](https://github.com/alexpts/psr15-next/actions/workflows/phpunit.yml/badge.svg?branch=master)](https://github.com/alexpts/psr15-next/actions/workflows/phpunit.yml)[![codecov](https://camo.githubusercontent.com/cd1b8512154f1b3f8394f0840cc2ea9fd9198401016159decf776f2f7efc5aa7/68747470733a2f2f636f6465636f762e696f2f67682f616c65787074732f70737231352d6e6578742f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d31344c36494a41355545)](https://codecov.io/gh/alexpts/psr15-next)

Runner for PSR-15 middlewares.

[See examples](https://github.com/alexpts/psr15-next/tree/master/examples)

- Named routes with URL generation
- Responds to `OPTIONS` requests with allowed methods
- Multiple route middleware
- Multiple routers
- Nestable routers
- PSR-15 middlewares
- PSR-7 request/response
- Flexible priority (low level)
- Dynamic endpoint (low level)

```
use Psr\Http\Message\ServerRequestInterface;
use PTS\NextRouter\Resolver\LayerResolver;
use PTS\NextRouter\Next;
use PTS\PSR15\Middlewares\ErrorToJsonResponse;
use PTS\ParserPsr7\SapiEmitter;
use PTS\Psr7\Factory\Psr17Factory;
use PTS\Psr7\Response\JsonResponse;

require_once '../vendor/autoload.php';

$psr17Factory = new Psr17Factory;
$app = new Next;

$app->getRouterStore()
    ->get('/hello', function (ServerRequestInterface $request, $next) {
        return new JsonResponse(['message' => 'Hello world'], 200);
    })
    ->use(function (ServerRequestInterface $request, $next) {
        return new JsonResponse(['message' => 'otherwise']);
    });

$request = $psr17Factory->fromGlobals();
$response = $app->handle($request);
(new SapiEmitter)->emit($response);
```

### Install

[](#install)

`composer require alexpts/psr15-next`

### Todo: add more examples

[](#todo-add-more-examples)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance54

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

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 ~48 days

Recently: every ~131 days

Total

18

Last Release

1987d ago

PHP version history (3 changes)0.0.1PHP ~7.2

0.3.0PHP ~7.4

0.5.0PHP ~8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/31106536118e11bf9d0c9d7f467db5b534efa9c46ee76680b308f0c39d9a798c?d=identicon)[alexpts](/maintainers/alexpts)

---

Top Contributors

[![alexpts](https://avatars.githubusercontent.com/u/1306916?v=4)](https://github.com/alexpts "alexpts (63 commits)")

---

Tags

middlewarephppsr-15psr-7middlewaremicrorouterroutingpsr-15

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alexpts-psr15-next/health.svg)

```
[![Health](https://phpackages.com/badges/alexpts-psr15-next/health.svg)](https://phpackages.com/packages/alexpts-psr15-next)
```

###  Alternatives

[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

121.6M26](/packages/mezzio-mezzio-authentication)[middlewares/fast-route

Middleware to use FastRoute

96191.1k15](/packages/middlewares-fast-route)[jimtools/jwt-auth

PSR-15 JWT Authentication middleware, A replacement for tuupola/slim-jwt-auth

20142.3k3](/packages/jimtools-jwt-auth)[middlewares/aura-router

Middleware to use Aura.Router

1110.9k3](/packages/middlewares-aura-router)

PHPackages © 2026

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