PHPackages                             kryptamine/groot - 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. kryptamine/groot

ActiveLibrary

kryptamine/groot
================

PHP 8 attributes based router adapter

0.0.1(4y ago)119MITPHPPHP ^8.0

Since Sep 26Pushed 4y ago2 watchersCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

PHP 8 attributes router adapter
===============================

[](#php-8-attributes-router-adapter)

This package is an adapter that provides the ability to integrate PHP 8 attributes with any router you'd prefer to use.

```
use Kryptamine\Groot\Attributes\Get;
use Kryptamine\Groot\Attributes\Post;
use Kryptamine\Groot\Attributes\Controller;

#[Controller('users')]
class UserController
{
    #[Get('/')]
    public function getUsers(): void
    {

    }

    #[Get('/{id:\d+}')]
    public function getUser(int $id): void
    {

    }

    #[Post('/')]
    public function saveUser(): void
    {

    }

    ...
}
```

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

[](#installation)

1. Install the package via composer:

```
composer require kryptamine/groot
```

2. Use a supported adapter or implement [your own](#supported-adapters)

Usage example
-------------

[](#usage-example)

```
namespace Kryptamine\Groot;

use Kryptamine\Groot\Router;
use Bramus\Router\Router as BramusRouter;
use Kryptamine\Groot\Adapters\BramusRouterAdapter;

require 'vendor/autoload.php';

$bramusRouter = new BramusRouter();

$router = new Router(BramusRouterAdapter::fromBramusRouter($bramusRouter), [
    UserController::class,
]);

$router->register();

$bramusRouter->run();
```

Supported Adapters
------------------

[](#supported-adapters)

[bramus/router](https://github.com/bramus/router)

[nikic/FastRoute](https://github.com/nikic/FastRoute)

To create your own adapter, you should implement [RouteRegistrarAdapterInterface](https://github.com/kryptamine/groot/blob/main/src/Adapters/RouteRegistrarAdapterInterface.php)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

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

Unknown

Total

1

Last Release

1696d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d329337a4ea6f2594195147ce2c783f03e3b7f36872d0f283a0bdbf302866775?d=identicon)[kryptamine](/maintainers/kryptamine)

---

Top Contributors

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

---

Tags

routerphp-attributes

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kryptamine-groot/health.svg)

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

###  Alternatives

[symfony/routing

Maps an HTTP request to a set of configuration variables

7.6k789.4M1.8k](/packages/symfony-routing)[slim/slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs

12.3k49.9M1.3k](/packages/slim-slim)[nikic/fast-route

Fast request router for PHP

5.3k92.4M668](/packages/nikic-fast-route)[league/route

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

6633.1M115](/packages/league-route)[contributte/api-router

RESTful Router for your Apis in Nette Framework - created either directly or via attributes

20802.8k3](/packages/contributte-api-router)

PHPackages © 2026

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