PHPackages                             bimacoding/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. bimacoding/router

ActiveLibrary

bimacoding/router
=================

simple router class for php

2.5(3y ago)0191MITPHPPHP &gt;=7.2.5

Since Dec 6Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (1)

Router
------

[](#router)

```
  _____  _    _ _____             _____             _
 |  __ \| |  | |  __ \           |  __ \           | |
 | |__) | |__| | |__) |  ______  | |__) |___  _   _| |_ ___ _ __
 |  ___/|  __  |  ___/  |______| |  _  // _ \| | | | __/ _ \ '__|
 | |    | |  | | |               | | \ \ (_) | |_| | ||  __/ |
 |_|    |_|  |_|_|               |_|  \_\___/ \__,_|\__\___|_|

```

**PHP Router**, which also has rich features like Middlewares and Controllers is simple and useful router class for PHP.

### Features

[](#features)

- Supports GET, POST, PUT, DELETE, OPTIONS, PATCH, HEAD, AJAX and ANY request methods
- Easy access and manage Request and Response via `symfony/http-foundation` package.
- Controllers support (Example: HomeController@about)
- Before and after Route Middlewares support
- Static Route Patterns
- Dynamic Route Patterns
- Easy-to-use patterns
- Adding a new pattern supports. (with RegExp)
- Namespaces supports.
- Group Routing
- Custom 404 and Exception handling
- Debug mode (Error message open/close)

Install
-------

[](#install)

To install **PHP Router**, You can run the following command directly at your project path in your console:

```
$ composer require bimacoding/router

```

OR you can add following lines into the `composer.json` file manually:

```
{
    "require": {
        "bimacoding/router": "^2.0"
    }
}
```

Then, run the following command:

```
$ composer install

```

Example Usage
-------------

[](#example-usage)

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

use Alza\Router\Router;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

$router = new Router;

// For basic GET URI
$router->get('/', function(Request $request, Response $response) {
    $response->setContent('Hello World');
    return $response;

    # OR
    # return 'Hello World!';
});

// For basic GET URI by using a Controller class.
$router->get('/test', 'TestController@main');

// For auto discovering all methods and URIs
$router->controller('/users', 'UserController');

$router->run();
```

Docs
----

[](#docs)

Documentation page: [Alza\\Router Docs](https://github.com/bimacoding/php-router/wiki)

Changelogs: [Alza\\Router Changelogs](https://github.com/bimacoding/php-router/wiki/Changelogs)

Support
-------

[](#support)

[bimacoding's homepage](http://vitech.asia)

[bimacoding's twitter](https://twitter.com/bimacoding)

Licence
-------

[](#licence)

[MIT Licence](http://opensource.org/licenses/MIT)

Contributing
------------

[](#contributing)

1. Fork it (  )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request

Contributors
------------

[](#contributors)

- [bimacoding](https://github.com/bimacoding) Arif iik - creator, maintainer

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

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

1260d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b156c8695cdca5806090f543f6d59128c24593175a033f905302985f98a0212?d=identicon)[bimacoding](/maintainers/bimacoding)

---

Top Contributors

[![bimacoding](https://avatars.githubusercontent.com/u/61307168?v=4)](https://github.com/bimacoding "bimacoding (2 commits)")

---

Tags

routerroutingroute

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[aura/router

Powerful, flexible web routing for PSR-7 requests.

5231.5M67](/packages/aura-router)[pecee/simple-router

Simple, fast PHP router that is easy to get integrated and in almost any project. Heavily inspired by the Laravel router.

696214.6k17](/packages/pecee-simple-router)[izniburak/router

simple router class for php

23522.6k7](/packages/izniburak-router)[pmjones/auto-route

Automatically routes HTTP request to action classes.

20158.6k6](/packages/pmjones-auto-route)[miladrahimi/phprouter

A powerful, lightweight, and very fast HTTP URL router for PHP projects.

20832.6k2](/packages/miladrahimi-phprouter)[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)
