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

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

vs/router
=========

VarYan's Router package

044PHP

Since Oct 2Pushed 7y agoCompare

[ Source](https://github.com/varyandeveloper/vs-router)[ Packagist](https://packagist.org/packages/vs/router)[ RSS](/packages/vs-router/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependenciesVersions (1)Used By (0)

vs/router
=========

[](#vsrouter)

Description
-----------

[](#description)

An open source PHP ^7.2 Router object to make routing easier

Features
--------

[](#features)

- Supported request method (You can add any new method that you need)
    - GET
    - POST
    - PUT
    - PATCH
    - DELETE
- Prefixes (nested level)
- Namespaces (nested level)
- Naming
- No limit for segments
- Supported dynamic segments (You can add any new segment that you need)
    - (n) =&gt; /\[0-9\]/
    - (s) =&gt; /\[A-Za-z0-9\]/
- Supported destination types
    - String =&gt; "ControllerName.ActionName",
    - Closure =&gt; function (){} (if pattern will contain dynamic segments function will inject them automatically like ($S1,$S2,...$Sn))
    - array =&gt; \["ControllerName", "ActionName"\],
    - array (associative) =&gt; \[ "controller" =&gt; "ControllerName", "method" =&gt; "ActionName" \]

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

[](#installation)

- Add line "vs/router": "dev-master" into your composer file
- Change/Add "minimum-stability" of your composer file to "dev"
- Run composer install/update command on your terminal

Examples
--------

[](#examples)

### Method definition

[](#method-definition)

```
/**
 * @var \VS\Router\RouterInterface $router
*/
$router = \VS\General\DIFactory::injectClass(\VS\Router\Router::class);

$router->get('/', function(){
    // code for defined route gouse here
})->post('/login', 'ControllerName.actionName')
  ->delete(sprintf('/user/%s', \VS\Router\RouterConstants::NUMBER_ARGUMENT_ALIAS), function($id){
    // code for delete user with ID $id gouse here
  });
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9fa5b1bc8f9a038afce83adad6c9df185b4f34b03dadae357b69a16339604fbe?d=identicon)[varyandeveloper](/maintainers/varyandeveloper)

---

Top Contributors

[![varyan007](https://avatars.githubusercontent.com/u/185356467?v=4)](https://github.com/varyan007 "varyan007 (34 commits)")

### Embed Badge

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

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

###  Alternatives

[winzou/state-machine-bundle

Bundle for the very lightweight yet powerful PHP state machine

34010.4M15](/packages/winzou-state-machine-bundle)[xethron/laravel-4-generators

Rapidly generate resources, migrations, models, and much more.

972.8M10](/packages/xethron-laravel-4-generators)[cornernote/gii-modeldoc-generator

Gii ModelDoc Generator for Yii framework

13109.1k](/packages/cornernote-gii-modeldoc-generator)[vanthao03596/laravel-hanhchinhvn

hành chính việt nam laravel

406.3k](/packages/vanthao03596-laravel-hanhchinhvn)

PHPackages © 2026

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