PHPackages                             netherphp/avenue - 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. netherphp/avenue

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

netherphp/avenue
================

A Request Router.

v4.0.3(4y ago)02.7k11BSD-2-ClausePHPPHP ^8.0CI passing

Since May 5Pushed 1y agoCompare

[ Source](https://github.com/netherphp/avenue)[ Packagist](https://packagist.org/packages/netherphp/avenue)[ RSS](/packages/netherphp-avenue/feed)WikiDiscussions redux Synced 1mo ago

READMEChangelogDependencies (3)Versions (23)Used By (1)

Nether Avenue
=============

[](#nether-avenue)

[![Packagist](https://camo.githubusercontent.com/a92a0a28760755e07a25c5fc5e231d5669bc60e5d85ee8982193d7a504899d0b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e65746865727068702f6176656e75652e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/netherphp/avenue)[![Build Status](https://camo.githubusercontent.com/a0ec18029c8ebc58d3c27da7f50e14901a676723d606aaaa3b60fb860e3711f3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6e65746865727068702f6176656e75652f706870756e69742e796d6c3f7374796c653d666f722d7468652d6261646765)](https://github.com/netherphp/avenue/actions)[![codecov](https://camo.githubusercontent.com/b145bf3d585fb874b0d79659d25d3b523d40fb26c7e6b03f379c7b348b8bf052/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f6e65746865727068702f6176656e75653f7374796c653d666f722d7468652d626164676526746f6b656e3d5651433438584e425332)](https://codecov.io/gh/netherphp/avenue)

A PHP 8+ annotation based request router. It is able to scan through a directory of routes/controllers and determine which ones should get executed to satisfy incoming request.

Routes are able to define via the `RouteHandler` attribute, the path, domain, and HTTP verb they are willing to answer. They can also extract information from the URI and pass them to the method. It will make sure the data is of the types declared on the method signature.

Routes are *checked if they can* handle a request based on the request parameters (Verb, Domain, and Path). Then routes are *asked if they will* handle a request. A method just for checking the willingness of a route handler can be defined with the `ConfirmWillAnswerRequest` attribute.

The Router is able to both scan a directory on the fly to generate the route map (nice for development), as well as there is a vendor bin script, `netherave`, which is able to generate a static route map file that the Router will load to speed things up.

Quickstart
==========

[](#quickstart)

How-To on getting the library up and running on a fresh project.

-

Documentation
=============

[](#documentation)

All documentation that exists is currently on the GitHub wiki.

-

---

*Example Router (www\\index.php)*

```
require('vendor/autoload.php');

$Config = Nether\Avenue\Library::PrepareDefaultConfig();
$Router = new Nether\Avenue\Router($Config);
$Router->Run();
```

*Example Route (routes\\Home.php)*

```
namespace Routes;

use Nether\Avenue;

class Home
extends Avenue\Route {

	#[Avenue\Meta\RouteHandler('/index')]
	public function
	Index():
	void {

		echo 'Home Page.';
		return;
	}

	#[Avenue\Meta\RouteHandler('/dashboard')]
	#[Avenue\Meta\ConfirmWillAnswerRequest]
	public function
	Dashboard():
	void {

		echo 'User Dashboard.';
		return;
	}

	public function
	DashboardWillAnswerRequest():
	int {

		$User = YourAppSessionLib::GetCurrentUser();

		if($User && $User->CanHasDashboard())
		return Avenue\Response::CodeOK;

		return Avenue\Response::CodeForbidden;
	}

	#[Avenue\Meta\ErrorHandler(403)]
	public function
	HandleForbidden():
	void {

		echo "Dude No.";
		return;
	}

	#[Avenue\Meta\ErrorHandler(404)]
	public function
	HandleNotFound():
	void {

		echo "Bruh Wut?";
		return;
	}

}
```

*Example Static Map Generation (CLI)*

```
$ netherave gen routes --show
Route Directory: routes
Route File: ./routes.phson

Summary:
 * GET (2)
   Routes\Home::Index
   Routes\Home::Dashboard

 * Error Handlers (2)
   Routes\Home::HandleForbidden
   Routes\Home::HandleNotFound

```

Notes
=====

[](#notes)

This is not a PSR compliant anything. It do as it be.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity78

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

Recently: every ~159 days

Total

21

Last Release

1546d ago

Major Versions

v1.0.1 → v2.0.02016-02-26

v2.0.7 → v3.0.02017-08-18

v3.0.6 → v4.0.02021-01-07

PHP version history (2 changes)v4.0.0PHP &gt;=8.0

v4.0.2PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

phprouter

### Embed Badge

![Health badge](/badges/netherphp-avenue/health.svg)

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

###  Alternatives

[aphiria/aphiria

The Aphiria framework

1427.7k2](/packages/aphiria-aphiria)[wilaak/radix-router

High-performance radix tree based HTTP request router

612.8k5](/packages/wilaak-radix-router)[eftec/routeone

Router service class for PHP

291.4k2](/packages/eftec-routeone)[divineniiquaye/flight-routing

Flight routing is a simple, fast PHP router that is easy to get integrated with other routers.

152.5k](/packages/divineniiquaye-flight-routing)

PHPackages © 2026

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