PHPackages                             symphlion/trail - 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. symphlion/trail

ActiveLibrary[Framework](/categories/framework)

symphlion/trail
===============

A small routing library written

013PHP

Since Apr 12Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Symphlion/Trail)[ Packagist](https://packagist.org/packages/symphlion/trail)[ RSS](/packages/symphlion-trail/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

### To use it

[](#to-use-it)

first, time to require the packages ofcourse..

```
    composer require symphlion/trail

```

Somewhere in your code, make sure to autoload it all

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

```

And after that, you can start using it.

```
use \Trail\Router;

Router::get('/account/:id', function( $id ) {

    echo 'The ID is ' . $id;

});

// After defining your routes, we need to call 1 method to bootrstrap the checking
Router::verify();

// to retrieve the instance, simply call it
$router = Router::instance();

$router->get(
    '/events/birthday/:selection',
    '{namespace}@allBirthdays',
    [':selection' => '[a-zA-Z\-]{1,3}']
);

// you can specify both a name and a group for a route

$router->get(
    '/users/:id',
    function( $selection ) {
        echo 'This is your selection!';
    },
    ['name' => 'user-overview'] // this gives this route the name: user-overview
);

// A different way to name a route:
$router->get(
    '/users/:id',
    function( $selection ) {
        echo 'This is your selection!';
    }
)->name('user-overview');

// we also support collections
// In fact, we encourage collections, as it narrows down the search paths to follow
// hence making it faster to react and match a route

$collections = [
    [
        'name' => 'account',
        'namespace' => '\\App\\Account',
        'prefix' => true,
        'scheme' => 'http',
        'domain' => 'www.your-domain.com'
    ]
];

// optionally, you can also specify the entire routing array within a collection
// like so

$collections = [
    [
        'name' => 'account',                // required, every collection needs a name right? however, you can also specify the key of this array as the name
        'path' => '/accounts',              // required, the scoped path to listen for
        'namespace' => '\\App\\Account',    // optional but highly recommended
        'prefix' => true,                   // optional, whether you want methods to be prefixed by the request_method
        'scheme' => 'http',                 // optional, liten to a specific host scheme
        'domain' => 'www.your-domain.com',  // optional, listen to a specific domain
        'routes' => [
            [
                ['get', 'post', 'put'],
                '/:id'                      // notice how a route within a collection will scope to the /accounts path from it`s parent collection
            ]
        ]
    ]
];
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b7340bfb8c5a668b19d17a30f8a7e85a6f1c20c091f86cdc77a5ef10f80343f?d=identicon)[Symphlion](/maintainers/Symphlion)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/symphlion-trail/health.svg)

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M191](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M256](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M592](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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