PHPackages                             underdash/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. underdash/router

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

underdash/router
================

The minimal router

1.1(4y ago)213GPL-3.0+PHP

Since May 16Pushed 4y ago1 watchersCompare

[ Source](https://github.com/tahashieenavaz/router)[ Packagist](https://packagist.org/packages/underdash/router)[ RSS](/packages/underdash-router/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (10)Used By (0)

Minimal PHP Request Router
==========================

[](#minimal-php-request-router)

Every professional web developer knows handling request routing can be a pain in the \*\*\*. I sometimes **wished** there could be an excessively lightweight library which handles request routing. So I wasn't forced to load Laravel or even Lumen to do so. This repository contains my solution for my own problem but I think others will find it useful too.

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

[](#installation)

```
composer require underdash/router
```

Using Closures
--------------

[](#using-closures)

```
use Underdash\Router;

Router::get('/', function() {
  return "Welcome to my blog!";
});

Router::dispatch();
```

Using Controllers
-----------------

[](#using-controllers)

```
use Underdash\Router;

class PagesController {
    public static function index(){
        return "Welcome from controller!";
    }
}

Router::get('/', 'PagesController@index');

Router::dispatch();
```

Minimal Wildcard Support
------------------------

[](#minimal-wildcard-support)

```
use Underdash\Router;

Router::get('/user/{name}', function($name) {
  return "You are probably {$name}, and I know it!";
});

Router::dispatch();
```

Working with POST params made easy
----------------------------------

[](#working-with-post-params-made-easy)

```
use Underdash\Router;

Router::post('register', function() {
  $name = arg('name');
  return "Thanks for registering in our web service, {$name}";
});

Router::dispatch();
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Total

9

Last Release

1486d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00be582c0d5f164956adc712d399f76e7710aa3aadabb5126533974bf5c0a66a?d=identicon)[tahashieenavaz](/maintainers/tahashieenavaz)

---

Top Contributors

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

---

Tags

fastrequestrouterroutingrouterroutingrouteeasyminimal

### Embed Badge

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

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

###  Alternatives

[bramus/router

A lightweight and simple object oriented PHP Router

1.1k490.5k55](/packages/bramus-router)[izniburak/laravel-auto-routes

Auto Route Generating (Auto-Discovery) Package for Laravel

23549.7k](/packages/izniburak-laravel-auto-routes)[illuminatech/url-trailing-slash

Allows enforcing URL routes with or without trailing slash

48234.4k](/packages/illuminatech-url-trailing-slash)[proai/lumen-annotations

Route and event binding annotations for Laravel Lumen

1012.7k](/packages/proai-lumen-annotations)

PHPackages © 2026

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