1
- # Laravel Docs Generator
1
+ <p align =" center " >
2
+ <a href =" https://github.com/rakutentech/laravel-request-docs " >
3
+ <img alt="Laravel Request Docs" src="https://imgur.com/9eDTUaI.png" width="360">
4
+ </a >
5
+ </p >
6
+
7
+ <p align =" center " >
8
+ The Hassle-Free API documentation generation tool for Laravel. <br >
9
+ A Swagger alernative.
10
+ </p >
11
+
12
+ ** Fast:** Install on any Laravel Project
13
+
14
+ ** Hassle Free:** Auto Generate API Documentation with request rules and parameters
15
+
16
+ ** Analyze:** In build SQL query time analyzer, response time and headers output.
17
+
18
+ ## Features
19
+
20
+ - Automatic routes fetching from Laravel Routes
21
+ - Automatic rules fetching from injected Request
22
+ - Support for Authorization Headers
23
+ - Support for SQL query, response time and memory consumption by request on Laravel
24
+ - Intelligent auto request builder using `` faker.js ``
25
+ - Display extra documentation using markdown
26
+ # Read on Medium
2
27
3
28
Automatically generate api documentation for Laravel without writing annotations.
4
29
@@ -11,7 +36,7 @@ Read more: https://medium.com/web-developer/laravel-automatically-generate-api-d
11
36
| PHP | 7.4 or 8.0 |
12
37
| Laravel | 6.* or 8.* or 9.* |
13
38
14
- ## Installation
39
+ # Installation
15
40
16
41
You can install the package via composer:
17
42
@@ -26,7 +51,7 @@ You can publish the config file with:
26
51
php artisan vendor:publish --tag=request-docs-config
27
52
```
28
53
29
- ## Usage
54
+ # Usage
30
55
31
56
View in the browser on `` /request-docs/ ``
32
57
@@ -38,31 +63,59 @@ php artisan lrd:generate
38
63
39
64
Docs HTML is generated inside `` docs/ `` .
40
65
41
- ## Design pattern
66
+ # Design pattern
42
67
43
68
In order for this plugin to work, you need to follow the design pattern by injecting the request class inside the controller.
44
69
For extra documentation you can use markdown inside your controller method as well.
45
70
46
71
![ Design pattern] ( https://imgur.com/yXjq3jp.png )
47
72
48
- ### Screenshots
73
+ # Screenshots
49
74
50
- Generated API documentation
75
+ ** Generated API documentation**
51
76
52
77
![ Preview] ( https://imgur.com/8DvBBhs.png )
53
78
54
- Try API
79
+ ** Try API**
55
80
56
81
![ Preview] ( https://imgur.com/kcKVSzm.png )
57
82
83
+ ** SQL query profile**
84
+
85
+ ![ Preview] ( https://imgur.com/y8jT3jj.png )
86
+
87
+ ** Resonse profile**
88
+
89
+ ![ Preview] ( https://imgur.com/U0Je956.png )
90
+
91
+ ** Customize Headers**
92
+
93
+ ![ Preview] ( https://imgur.com/5ydtRd8.png )
94
+
95
+
96
+ # Extra
97
+
98
+ You write extra documentation in markdown which will be rendered as HTML on the dashboard.
99
+ Example of using it in controller
100
+
101
+ ``` php
102
+ /**
103
+ * @lrd:start
104
+ * #Hello markdown
105
+ * ## Documentation for /my route
106
+ * @lrd:end
107
+ */
108
+ public function index(MyIndexRequest $request): Resource
109
+ {
110
+ ```
58
111
59
- ## Testing
112
+ # Testing
60
113
61
114
``` bash
62
115
./vendor/bin/phpunit
63
116
```
64
117
65
- ## Linting
118
+ # Linting
66
119
67
120
``` bash
68
121
./vendor/bin/phpcs --standard=phpcs.xml --extensions=php --ignore=tests/migrations config/ src/
@@ -75,11 +128,12 @@ Fixing lints
75
128
./vendor/bin/php-cs-fixer fix config/
76
129
```
77
130
78
- ## Changelog
131
+ # Changelog
79
132
80
133
- Initial Release
81
134
- v1.9 Added improvements such as status code, response headers, custom request headers and fixed issues reported by users
82
135
- v1.10 Show PHP memory usage, gzip encoding fix
83
136
- v1.12 Bug Fix of id, and Laravel 9 support
84
137
- v1.13 Laravel 9 support
138
+ - v1.14 `` __invoke() `` support
85
139
0 commit comments