grimbees/docrouter

Document Router is a Laravel library that allow you to define routing on controller documentation

dev-master / 0.0.1.x-dev 2018-12-11 12:58 UTC

This package is auto-updated.

Last update: 2024-05-12 04:13:05 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