PHPackages                             vagkalosynakis/league-router-attributes - 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. vagkalosynakis/league-router-attributes

ActiveLibrary[HTTP &amp; Networking](/categories/http)

vagkalosynakis/league-router-attributes
=======================================

Attribute-based routing for league/route (PHP 8+)

v0.1.0(3mo ago)11MITPHPPHP ^8.0CI passing

Since Feb 10Pushed 3mo agoCompare

[ Source](https://github.com/vagkalosynakis/league-router-attributes)[ Packagist](https://packagist.org/packages/vagkalosynakis/league-router-attributes)[ RSS](/packages/vagkalosynakis-league-router-attributes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

League Route Attributes
=======================

[](#league-route-attributes)

[![PHP Version](https://camo.githubusercontent.com/911a83e2aa6fe73660ab613629a95c76622bf03049a7344e80c5ea72d4ef9c7d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e302d626c7565)](https://www.php.net)[![League Route](https://camo.githubusercontent.com/6a8ab8cce778f11edfdfa5b6438c75f39c821843d6cbce0fac4da87fb676fa58/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6561677565253246726f7574652d253545352e312d677265656e)](https://route.thephpleague.com/)[![License](https://camo.githubusercontent.com/88e1dabf4d223df0950e0985948e231325fefca9fa7fe9e446cf8b1c5e9d9e47/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e)](LICENSE)

Attribute-based routing for [league/route](https://route.thephpleague.com/). Define routes using PHP 8 attributes directly on controller methods, eliminating manual route registration boilerplate.

Requirements
------------

[](#requirements)

- PHP ^8.0
- league/route ^5.1
- psr/container ^1.0|^2.0

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

[](#installation)

```
composer require vagkalosynakis/league-router-attributes
```

Usage
-----

[](#usage)

### Basic Routing

[](#basic-routing)

Use the `#[Route]` attribute to declare routes on controller methods:

```
