PHPackages                             marrios/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. [Framework](/categories/framework)
4. /
5. marrios/router

ActiveLibrary[Framework](/categories/framework)

marrios/router
==============

Route manager

v2.2.3(2y ago)32984GPL-3.0PHPPHP &gt;=8.0

Since Apr 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/edmariooliver/Marea-Turbo-Router)[ Packagist](https://packagist.org/packages/marrios/router)[ RSS](/packages/marrios-router/feed)WikiDiscussions v2.2.0 Synced 1mo ago

READMEChangelog (9)DependenciesVersions (15)Used By (0)

 [![Total Downloads](https://camo.githubusercontent.com/f72d82ebcf1a09601c7aa4097a2a5ef304efa541940a713d8127f10d6190e520/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d617272696f732f726f75746572) ](https://packagist.org/packages/marrios/router)[![Latest Stable Version](https://camo.githubusercontent.com/e3165e879071054aa8c67331483ff8aa40b1999cbd4ff8dd5c3f73e7064edffc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d617272696f732f726f75746572)](https://packagist.org/packages/marrios/router) [![License](https://camo.githubusercontent.com/087334dae36af9f5a6718f4f3724c392d019cb74fe81acc41d3c64521d9b1bc5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d617272696f732f726f75746572)](https://packagist.org/packages/marrios/router)

@marriosdev

Marrios/Router
==============

[](#marriosrouter)

#### HTTP Route Manager for MVC Projects

[](#http-route-manager-for-mvc-projects)

#### Any bug you find, you can open PR

[](#any-bug-you-find-you-can-open-pr)

Guide
-----

[](#guide)

- ### [Starting](#starting)

    [](#starting)
- ### [Parameters](#parameters)

    [](#parameters)
- ### [Middlewares](#middlewares)

    [](#middlewares)

Starting
========

[](#starting-1)

0 - Installing
--------------

[](#0---installing)

```
composer require marrios/router
```

1 - Using functions
-------------------

[](#1---using-functions)

```

use Marrios\Router\HttpRouter;

$router = new HttpRouter();

// Set route
$router->get("/helloworld", [function(){ echo "Hello World!";}])->run();
$router->notFound();
```

When accessing the /helloworld route

```
   Hello World!
```

2 - Using Controllers
---------------------

[](#2---using-controllers)

```
use App\Controllers\TesteController;

use Marrios\Router\HttpRouter;

$router = new HttpRouter();

// Set route
$router->post("/helloworld", [TesteController::class, "helloWorld"])->run();
$router->notFound();
```

When accessing the /helloworld route

```
   Hello World!
```

Parameters
==========

[](#parameters-1)

Using dynamic parameters
------------------------

[](#using-dynamic-parameters)

### Dynamic parameters are defined using curly braces { }

[](#dynamic-parameters-are-defined-using-curly-braces--)

### \* Note: When defining a dynamic route, you must add a parameter to the callback function or in the controller method

[](#-note-when-defining-a-dynamic-route-you-must-add-a-parameter-to-the-callback-function-or-in-the-controller-method)

### Follow the example below using CallBack:

[](#follow-the-example-below-using-callback)

```
use Marrios\Router\HttpRouter;

$router = new HttpRouter();

// Set route
$router->post("/blog/{category}/{id_post}", [ function($param){ echo $param->category;}])->run();
$router->notFound();
```

When accessing the /blog/video/1323 route

```
   video
```

### Follow the example below using Controller:

[](#follow-the-example-below-using-controller)

```
use Marrios\Router\HttpRouter;

$router = new HttpRouter();

// Instantiating the route object
$router = new Router();

// Set route
$router->get("/blog/{category}/{id_post}", [TesteController::class, "helloWorld"])->run();
$router->notFound();
```

### Your controller should look like this

[](#your-controller-should-look-like-this)

```
class TesteController
{
    public function helloWorld($param)
    {
        echo $param->id_post;
    }
}
```

When accessing the /blog/video/1323 route

```
   1323
```

Routes Group
============

[](#routes-group)

### Implement route groups

[](#implement-route-groups)

---

### Group

[](#group)

```
$router->group([
    $router->get("ok",  [function () {echo "Hello";}])->run(),
    $router->get("ok2",  [function () {echo "Hello 2";}])->run()
]);
```

### Route Group with Middleware

[](#route-group-with-middleware)

```
$router->middleware([Middleware::class])->group([
    $router->get("ok",  [function () {echo "Hello";}])->run(),
    $router->get("ok2",  [function () {echo "Hello 2";}])->run()
]);
```

Access logs
===========

[](#access-logs)

### Enable logs and define the location where the logs will be stored. Note: this line must be defined at the beginning of the file

[](#enable-logs-and-define-the-location-where-the-logs-will-be-stored-note-this-line-must-be-defined-at-the-beginning-of-the-file)

```
$router->logs(logs: true)->setStorageLogs(__DIR__);
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 69% 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 ~32 days

Recently: every ~5 days

Total

15

Last Release

1036d ago

Major Versions

v1.2.0 → v2.0.02022-05-14

PHP version history (2 changes)v1.0.0PHP &gt;=7.4

2.1.1PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/447d1f31e0d3c018d28dd21dd4c73a21cb1dd21aabb97ddb3057ab130e6750ea?d=identicon)[edmariooliver](/maintainers/edmariooliver)

---

Top Contributors

[![marriosdev](https://avatars.githubusercontent.com/u/49793161?v=4)](https://github.com/marriosdev "marriosdev (29 commits)")[![Edmario2002](https://avatars.githubusercontent.com/u/55308703?v=4)](https://github.com/Edmario2002 "Edmario2002 (13 commits)")

---

Tags

httpphprequestsrouterroutingroutermanagermvc

### Embed Badge

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

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

###  Alternatives

[vectorface/snappy-router

A quick and snappy routing framework.

4614.7k](/packages/vectorface-snappy-router)

PHPackages © 2026

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