hurongsheng/laravel-route-doc

easily create doc based on route.php

2.1.5 2016-12-30 03:26 UTC

This package is not auto-updated.

Last update: 2024-12-11 20:59:53 UTC


README

create api doc based on route.php & controller's document.

Install

Require this package with composer using the following command:

composer require hurongsheng/laravel-route-doc

Usage

add hurongsheng\LaravelRouteDoc\RouteDocServiceProvider::class into config/app.php--providers
php artisan vendor:publish --provider="hurongsheng\LaravelRouteDoc\RouteDocServiceProvider"
php artisan migrate
declare SomeController extend hurongsheng\LaravelRouteDoc\Controllers\RouteDocController;
and declare Route::controller() SomeController;
hurongsheng\LaravelRouteDoc\Controllers\RouteDocController extend App\Http\Controllers\Controller
     config:config/route_doc.php
     RouteDocController@getManage return default view of doc
     RouteDocController@getList return default view of doc
     
     visit manage and click update route&update doc then wait reload
     

Rules in controller document

/**
 * @description   function description
 * @param Request $request
 * @param         $id
 * @request       $name
 * @request       $something
 * @return SomeClass
 * @author your name
 */
 
 @request==@param

Helper

add @description @request document when in phpstorm

http://jingyan.baidu.com/article/48b558e35b81c27f38c09ab7.html