PHPackages                             ap-lib/routing-builder - 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. ap-lib/routing-builder

ActiveLibrary[Framework](/categories/framework)

ap-lib/routing-builder
======================

031PHP

Since Mar 20Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

AP\\Routing\\Builder
====================

[](#aproutingbuilder)

[![MIT License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

A helper repository for managing routing indexes: This package allows you to define routes using attributes directly in your handlers, making the development process easier.

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

[](#installation)

```
composer require ap-lib/routing-builder
```

Features
--------

[](#features)

- Help to define [routing index](https://github.com/ap-lib/routing) using attributes
- Group routes easily with RouteGroup

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

[](#requirements)

- PHP 8.3 or higher

Getting started
---------------

[](#getting-started)

### Base controller

[](#base-controller)

```
class Main
{
    #[Route(path: "/")]
    public static function root(): string
    {
        return "hello world";
    }
}
```

### Group routes

[](#group-routes)

```
#[RouteGroup(path: "/users")]
class Users
{
    #[Route(path: "")]
    public static function list(): array
    {
        return [];
    }

    #[Route(path: "/create", method: Method::POST)]
    public static function create(): Json
    {
        return new Json(
            ["id" => 123456],
            201
        );
    }

    #[Route(path: "/update", method: Method::PUT)]
    public static function update(): Response
    {
        return new Response(code: 204);
    }

    #[Route(path: "/delete", method: Method::DELETE)]
    public static function delete(): Response
    {
        return new Response(code: 204);
    }
}
```

### Preparing an Index for All Classes in a Directory

[](#preparing-an-index-for-all-classes-in-a-directory)

For more details on routing and indexes, see:

```
$index = new HashmapIndex();

$builder = new ByAttributes(__DIR__ . "/Handlers");
$builder->modifyIndex($index);
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1215fe5ecc9ba0ab1c730d3c992125cf6ebf460562e66be71ebae127789d465a?d=identicon)[AntonPanfilov](/maintainers/AntonPanfilov)

---

Top Contributors

[![anton-panfilov](https://avatars.githubusercontent.com/u/1083546?v=4)](https://github.com/anton-panfilov "anton-panfilov (8 commits)")

### Embed Badge

![Health badge](/badges/ap-lib-routing-builder/health.svg)

```
[![Health](https://phpackages.com/badges/ap-lib-routing-builder/health.svg)](https://phpackages.com/packages/ap-lib-routing-builder)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M190](/packages/laravel-telescope)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M529](/packages/laravel-passport)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M255](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M591](/packages/laravel-prompts)

PHPackages © 2026

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