Download the PHP package g4t/easyroute without Composer
On this page you can find all versions of the php package g4t/easyroute. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download g4t/easyroute
More information about g4t/easyroute
Files in g4t/easyroute
Package easyroute
Short Description Modern Laravel 13 routing using PHP 8 attributes with auto-generation, nested controller support, and native route caching.
License MIT
Informations about the package easyroute
π Laravel 13 G4T easyRoute Attributes
A Laravel 13 package that lets you define routes using PHP 8 attributes with full support for Controller-level routes, Method-level routes, middleware, subfolders, and caching via Laravelβs routes-v7.php.
π Features
- Controller-level route attributes (
#[Route(uri: 'users')]) - Method-level route attributes (
#[Get],#[Post],#[Put],#[Patch],#[Delete],#[Any]) - Auto route generation using method names or
onControlleroption - Middleware support (controller-level + method-level)
- Nested folder support for controllers
- Route caching using Laravel compiled routes (
bootstrap/cache/routes-v7.php) - Configurable Controllers paths
βοΈ Installation
Install via Composer:
Publish config:
This creates config/route-attribute.php:
π Usage Controller-level Route
Supported HTTP Methods
| Attribute | HTTP Method |
|---|---|
| #[Get] | GET |
| #[Post] | POST |
| #[Put] | PUT |
| #[Patch] | PATCH |
| #[Delete] | DELETE |
| #[Any] | Any method |
β‘ Route Caching
To improve performance, EasyRoute can use Laravel compiled routes instead of scanning controllers for every request.
Steps:
-
Ensure cache is enabled in
config/route-attribute.php: - Run the caching command:
βοΈ Configuration
controllers_pathβ Array of paths where your controllers residecacheβ Use cached routes from routes-v7.php
π Notes Supports nested folders in controllers_path.
Use onController: true to auto-generate URI based on Controller and Method names.
Middleware is merged: controller-level + method-level.
Fully compatible with Laravel 13 attributes syntax.
β Notes for Developers
- Place your controllers inside controllers_path
- Add #[Route(...)] at the class level
- Add #[Get], #[Post], etc. at method level
- Use onController: true for automatic route naming
Run
php artisan route:cacheto generate cached routes
EasyRoute makes your Laravel 13 routing modern, clean, and high-performance.