PHPackages                             easy-route/easy-route - 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. easy-route/easy-route

Abandoned → [erandir/plug-route](/?search=erandir%2Fplug-route)Library[HTTP &amp; Networking](/categories/http)

easy-route/easy-route
=====================

Easy router for PHP

v2.2(8y ago)10512[1 issues](https://github.com/fsoaresjunior/easy-route/issues)MITPHPPHP &gt;=7.0

Since Aug 7Pushed 7y ago2 watchersCompare

[ Source](https://github.com/fsoaresjunior/easy-route)[ Packagist](https://packagist.org/packages/easy-route/easy-route)[ RSS](/packages/easy-route-easy-route/feed)WikiDiscussions master Synced today

READMEChangelog (4)DependenciesVersions (5)Used By (0)

easy-route
==========

[](#easy-route)

DEPRECIADO, USE O [PlugRoute](https://github.com/erandirjunior/plug-route)
==========================================================================

[](#depreciado-use-o-plugroute)

Requisitos
----------

[](#requisitos)

- PHP 7.0 &gt;=
- Composer

Instalação
----------

[](#instalação)

```
$ composer require easy-route/easy-route "v2.0"
```

Definindo rotas
---------------

[](#definindo-rotas)

> Crie uma objeto do tipo EasyRoute e passe um namespace por parâmetro.

```
use \EasyRoute\EasyRoute;

$route = new EasyRoute('\\Seu\\Namespace\\');
```

Adicionando rotas
-----------------

[](#adicionando-rotas)

> Rotas do tipo **GET**

```
$route->get('/', 'PessoaController.index');
```

> Rotas do tipo **POST**

```
$route->post('/', 'PessoaController.index');
```

Abaixo de todas as rotas definidas, chame o método `on()` da classe EasyRoute para a execução das rotas.

```
$route->on();
```

Definindo rotas dinâmicas
-------------------------

[](#definindo-rotas-dinâmicas)

```
$route->get('/{exemplo}', function() {
    echo 'Exemplo de funcionamento de rota dinâmica';
});
```

Trabalhando com callback
------------------------

[](#trabalhando-com-callback)

> Rota simples

```
$route->get('/teste/{exemplo}', function() {
    echo 'Exemplo de funcionamento de rota dinâmica';
});
```

> Rota dinâmica

```
Route->get('/home/{teste}', function() {
    echo "rota dinâmica";
});
```

Obtendo dados da url
--------------------

[](#obtendo-dados-da-url)

```
$route->get('/teste/{exemplo}', function($dados) {
    var_dump($dados);
});
```

Onde `$dados` é um array de valores dinâmicos da url.

Grupo de rotas
--------------

[](#grupo-de-rotas)

```
$route->group('/noticias', function($route) {
    $route->get('/esporte', function() {
        echo 'noticias sobre esporte';
    });

    $route->get('/tecnologia', function() {
        echo 'noticias sobre tecnologia';
    });
});
```

###  Health Score

30

—

LowBetter than 61% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 82.4% 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 ~109 days

Total

4

Last Release

2969d ago

Major Versions

v1.0 → v2.02018-06-30

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/26988909?v=4)[erandir](/maintainers/erandir)[@erandir](https://github.com/erandir)

---

Top Contributors

[![erandirjunior](https://avatars.githubusercontent.com/u/13579247?v=4)](https://github.com/erandirjunior "erandirjunior (14 commits)")[![eduardogalbiati](https://avatars.githubusercontent.com/u/7586945?v=4)](https://github.com/eduardogalbiati "eduardogalbiati (1 commits)")[![hexti](https://avatars.githubusercontent.com/u/13467750?v=4)](https://github.com/hexti "hexti (1 commits)")[![juniorb2ss](https://avatars.githubusercontent.com/u/3980385?v=4)](https://github.com/juniorb2ss "juniorb2ss (1 commits)")

### Embed Badge

![Health badge](/badges/easy-route-easy-route/health.svg)

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25026.8M85](/packages/php-http-cache-plugin)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

85997.3k130](/packages/httpsoft-http-message)[thesis/nats

Async (fiber based) client for Nats.

758.3k](/packages/thesis-nats)

PHPackages © 2026

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