PHPackages                             gede/routa - 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. gede/routa

ActiveLibrary[Framework](/categories/framework)

gede/routa
==========

Route attributes for Laravel

v1.0.3(yesterday)00MITPHPPHP ^8.1

Since Jun 22Pushed yesterdayCompare

[ Source](https://github.com/Gedekay/route-attributes)[ Packagist](https://packagist.org/packages/gede/routa)[ RSS](/packages/gede-routa/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (5)Used By (0)

Laravel Gede Routa
==================

[](#laravel-gede-routa)

Un package Laravel permettant de définir les routes directement dans les contrôleurs via des PHP Attributes (`#[Get]`, `#[Post]`, etc.), sans utiliser `routes/web.php` ou `routes/api.php`.

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

[](#installation)

Installe le package via Composer :

```
composer require gede/routa
```

Configuration
-------------

[](#configuration)

Le service provider est auto-enregistré grâce à l'auto-discovery de Laravel.

Si nécessaire, ajoute-le manuellement dans `config/app.php` :

```
'providers' => [
    // ...
    RouteAttributes\RouteAttributesServiceProvider::class,
],
```

---

Utilisation
-----------

[](#utilisation)

### Exemple simple

[](#exemple-simple)

```
use RouteAttributes\Attributes\Get;
use RouteAttributes\Attributes\Post;

class UserController extends Controller
{
    #[Get('/users', name: 'users.index')]
    public function index()
    {
        return response()->json(['users']);
    }

    #[Post('/users', name: 'users.store')]
    public function store()
    {
        return response()->json(['created']);
    }
}
```

---

Routes disponibles
------------------

[](#routes-disponibles)

MéthodeAttributExempleGET`#[Get]``#[Get('/users')]`POST`#[Post]``#[Post('/users')]`PUT`#[Put]``#[Put('/users/{id}')]`PATCH`#[Patch]``#[Patch('/users/{id}')]`DELETE`#[Delete]``#[Delete('/users/{id}')]`---

Exemple complet
---------------

[](#exemple-complet)

```
use RouteAttributes\Attributes\Get;
use RouteAttributes\Attributes\Post;
use RouteAttributes\Attributes\Put;
use RouteAttributes\Attributes\Delete;

class ProductController extends Controller
{
    #[Get('/products')]
    public function index() {}

    #[Get('/products/{id}')]
    public function show($id) {}

    #[Post('/products')]
    public function store() {}

    #[Put('/products/{id}')]
    public function update($id) {}

    #[Delete('/products/{id}')]
    public function destroy($id) {}
}
```

---

Comment ça fonctionne ?
-----------------------

[](#comment-ça-fonctionne-)

Ce package :

1. **Scanne** les contrôleurs Laravel
2. **Lit** les PHP Attributes
3. **Enregistre** automatiquement les routes via `Route::get()`, `Route::post()`, etc.

---

Avantages
---------

[](#avantages)

✔ Plus besoin de `routes/api.php` ou `routes/web.php`
✔ Code plus propre et centralisé
✔ Inspiré des frameworks modernes (Symfony, NestJS)
✔ Compatible Laravel 10+

---

Limitations
-----------

[](#limitations)

- Les routes sont chargées au boot de l'application
- Peut nécessiter un cache optimisé pour les gros projets
- Nécessite PHP 8.0 ou supérieur

---

Roadmap (idées futures)
-----------------------

[](#roadmap-idées-futures)

- `#[Prefix('/api')]` - Préfixe de route
- `#[Middleware('auth')]` - Middleware associé
- `#[Name('users.')]` - Nom de route
- Cache des routes (commande artisan)
- Support des Resource Controllers
- Scan optimisé (performance)

---

Contribution
------------

[](#contribution)

Les PR sont les bienvenues !

1. Fork le projet
2. Crée une branche `feature/ma-feature`
3. Commit tes changements
4. Ouvre une Pull Request

---

License
-------

[](#license)

MIT License - voir le fichier [LICENSE](LICENSE) pour plus de détails.

---

Support
-------

[](#support)

Si ce projet t'aide, n'hésite pas à mettre une star sur GitHub !

---

**Made with pour la communauté Laravel**

```

```

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

1d ago

PHP version history (2 changes)v1.0.0PHP ^8.0

v1.0.1PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/gede-routa/health.svg)

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

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.1k91.3M279](/packages/laravel-horizon)[laravel/sail

Docker files for running a basic Laravel application.

1.9k199.2M1.2k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

9782.1M161](/packages/laravel-ai)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76518.2M118](/packages/laravel-mcp)[illuminate/routing

The Illuminate Routing package.

1239.0M2.8k](/packages/illuminate-routing)[laravel/surveyor

Static analysis tool for Laravel applications.

8690.3k12](/packages/laravel-surveyor)

PHPackages © 2026

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