ahmetbarut / laravel-route-docs
v0.1.3
2022-03-19 23:30 UTC
Requires
- php: ^7.4|^8.0
This package is auto-updated.
Last update: 2024-09-20 05:06:07 UTC
README
我们可能在想这些路由指向哪里,或者它们可能有什么用途?这个包决定解决这个问题。
这个包允许我们通过使用docBlock
注释的方式来轻松检索文档
/** * @route-doc * All comments written between these tags are collected and returned by the filter. * @end-doc */ Route::get('/home', function (){ return 'Hello Docs'; });
控制器内部的使用
Route::get('/home', 'HomeController@index'); // HomeController.php /** * @route-doc * All comments written between these tags are collected and returned by the filter. * @end-doc */ public function index() { return 'Hello Docs !'; }
安装
composer require ahmetbarut/laravel-route-docs
然后执行php artisan route:docs
来创建文档。
参数
这个包目前只输出markdown格式。可以使用path
参数,应写作php artisan route:docs /path/to
。
!提示
如果没有指定默认目录,它将在根目录中寻找名为`docs`的文件夹,如果找不到,则生成错误。