grimbees / docrouter
Document Router is a Laravel library that allow you to define routing on controller documentation
Requires
- php: ^5.3.3 || ^7.0
Requires (Dev)
- ext-intl: *
- phpunit/phpunit: ^4.0 || ^5.0
- squizlabs/php_codesniffer: ^1.5
This package is auto-updated.
Last update: 2025-01-12 05:30:45 UTC
README
Allow routing on controller class and method documentation
To install on laravel root directory terminal type composer require grimbees/docrouter
Supported annotation on controller class:
@middleware values, values would be any middleware that is registered
@prefix values, values would be any url escaped string
Supported annotation on controller method:
@method values, values would be any, post, get
@route values, values would be any url escaped string
To get started:
Add GrimBees\DocRouter\DocRouterServiceProvider::class to config/app.php on $providers
Example: MyController.php
namespace App\Http\Controllers; /** * Class MyController * @middleware web * @prefix my */ class MyController extends Controller { /** * @method any * @route test */ public function test() { return "test"; } }
Type composer dump-autoload is required for new controller
Test controller method will be exposed on /my/test