PHPackages                             debuss-a/fastroute-attribute-loader - 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. debuss-a/fastroute-attribute-loader

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

debuss-a/fastroute-attribute-loader
===================================

An attribute route loader for FastRoute.

1.1.0(3mo ago)08MITPHPPHP ^8.2CI passing

Since Jan 31Pushed 3mo agoCompare

[ Source](https://github.com/debuss/fastroute-attribute-loader)[ Packagist](https://packagist.org/packages/debuss-a/fastroute-attribute-loader)[ RSS](/packages/debuss-a-fastroute-attribute-loader/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (4)Used By (0)

FastRoute Attribute Loader
==========================

[](#fastroute-attribute-loader)

A simple and elegant route loader for [nikic/fast-route](https://github.com/nikic/FastRoute) that uses PHP 8 attributes to define routes directly on your controller methods.

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

[](#installation)

Install via Composer:

```
composer require debuss-a/fastroute-attribute-loader
```

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

[](#requirements)

- PHP 8.2 or higher
- nikic/fast-route ^1.0

Usage
-----

[](#usage)

### 1. Define Routes with Attributes

[](#1-define-routes-with-attributes)

Use the `#[Route]` attribute on your controller methods:

```
