PHPackages                             marekskopal/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. [API Development](/categories/api)
4. /
5. marekskopal/router

ActiveLibrary[API Development](/categories/api)

marekskopal/router
==================

Attributes extension for league/route router

v1.2.0(2mo ago)0770—0%MITPHPPHP &gt;=8.3

Since Apr 5Pushed 2mo ago1 watchersCompare

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

READMEChangelog (4)Dependencies (19)Versions (5)Used By (0)

Attributes extension for `league/route` router
==============================================

[](#attributes-extension-for-leagueroute-router)

Install
-------

[](#install)

```
composer require marekskopal/router
```

Usage
-----

[](#usage)

Create `Router` instance with `RouterBuilder` and set class directories of your controllers or actions. Optionally you can set `CacheInterface` instance for caching routes.

```
use MarekSkopal\Router\Builder\RouterBuilder;

$router = (new RouterBuilder())
    ->setClassDirectories([__DIR__ . '/../Controllers'])
    ->setCache(new Cache()) // optional
    ->build();
```

Add `Route` (or `RouteGet`,`RoutePost`,`RoutePut`,`RouteDelete`...) attribute on Class or Method you want to route to.

```
use MarekSkopal\Router\Attribute\Route;
use MarekSkopal\Router\Attribute\RoutePost;

class MyController
{
    #[Route('/api/my/name')]
    public function getName(): void
    {
    }

    #[RoutePost('/api/my/address')]
    public function postAddress(): void
    {
    }
}
```

```
use MarekSkopal\Router\Attribute\RouteGet;

#[RouteGet('/api/my/action')]
class MyAction
{
    public function __invoke(): void
    {
    }
}
```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance86

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Total

4

Last Release

69d ago

PHP version history (2 changes)v1.0.0PHP &gt;=8.1

v1.2.0PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/2eeb4a0e8bc7e2ce26f00193dac3973909911a18079b18956b03af66b901421a?d=identicon)[marekskopal](/maintainers/marekskopal)

---

Top Contributors

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

---

Tags

routerleagueattributesroute

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[league/route

Fast routing and dispatch component including PSR-15 middleware, built on top of FastRoute.

6633.1M115](/packages/league-route)[phroute/phroute

Fast, fully featured restful request router for PHP

739462.1k29](/packages/phroute-phroute)[pear2/net_routeros

This package allows you to read and write information from a RouterOS host using MikroTik's RouterOS API.

248111.7k4](/packages/pear2-net-routeros)[nezamy/route

Route - Fast, flexible routing for PHP, enabling you to quickly and easily build RESTful web applications.

21436.6k5](/packages/nezamy-route)[tobion/openapi-symfony-routing

Loads routes in Symfony based on OpenAPI/Swagger annotations

4219.5k](/packages/tobion-openapi-symfony-routing)[uderline/openapi-php-attributes

Automatically render your OpenApi 3 file describing your PHP API using attributes

2136.3k](/packages/uderline-openapi-php-attributes)

PHPackages © 2026

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