PHPackages                             romaluck/php-router - 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. [Framework](/categories/framework)
4. /
5. romaluck/php-router

ActiveLibrary[Framework](/categories/framework)

romaluck/php-router
===================

A simple router for PHP

v1.0.1(1y ago)01MITPHPPHP ^8.2

Since May 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/RomaLuck/SimplePhpRouter)[ Packagist](https://packagist.org/packages/romaluck/php-router)[ RSS](/packages/romaluck-php-router/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Table of contents
-----------------

[](#table-of-contents)

- [General info](#general-info)
- [Installation](#installation)
- [Usage](#usage)
- [Routing](#routing)
- [Controller](#controller)
- [Middleware](#middleware)

General info
------------

[](#general-info)

This is a simple router for PHP

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- Symfony/http-foundation &gt;= 7.2

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

[](#installation)

```
composer require romaluck/php-router

```

Usage
-----

[](#usage)

```
// Require composer autoloader
require __DIR__ . '/vendor/autoload.php';

$request = Request::createFromGlobals();

// Create Router instance
$router = new Romaluck\PhpRouter\Router($request);

// Define routes
// ...

// Run it!
$router->send();
```

Routing
-------

[](#routing)

```
$router->match(
    Route::get('/', IndexController::class)->addMiddleware(new AuthMiddleware()),
    Route::post('/upload', UploadImageController::class),
)
```

Controller
----------

[](#controller)

```
//Controller should implement ControllerInterface
class IndexController implements ControllerInterface
{
    public function __invoke(Request $request): Response
```

Middleware
----------

[](#middleware)

```
use Romaluck\PhpRouter\Middleware\MiddlewareInterface;
use Romaluck\PhpRouter\Middleware\RequestHandlerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

//Middleware should implement MiddlewareInterface
class AuthMiddleware implements MiddlewareInterface
{

    public function process(Request $request, RequestHandlerInterface $handler): Response
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance49

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Total

2

Last Release

374d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f7f5a3448e7a683029e9b9f40786749eb5eece5b7cd7c01c263b1addbea17cf?d=identicon)[RomaLuck](/maintainers/RomaLuck)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/romaluck-php-router/health.svg)

```
[![Health](https://phpackages.com/badges/romaluck-php-router/health.svg)](https://phpackages.com/packages/romaluck-php-router)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k235.4M9.7k](/packages/symfony-framework-bundle)[laravel/reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.

1.5k9.4M48](/packages/laravel-reverb)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

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