Skip to content

Commit c7df18d

Browse files
README updated
1 parent 8632d8b commit c7df18d

File tree

2 files changed

+65
-10
lines changed

2 files changed

+65
-10
lines changed

README.md

Lines changed: 64 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
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
227

328
Automatically generate api documentation for Laravel without writing annotations.
429

@@ -11,7 +36,7 @@ Read more: https://medium.com/web-developer/laravel-automatically-generate-api-d
1136
| PHP | 7.4 or 8.0 |
1237
| Laravel | 6.* or 8.* or 9.* |
1338

14-
## Installation
39+
# Installation
1540

1641
You can install the package via composer:
1742

@@ -26,7 +51,7 @@ You can publish the config file with:
2651
php artisan vendor:publish --tag=request-docs-config
2752
```
2853

29-
## Usage
54+
# Usage
3055

3156
View in the browser on ``/request-docs/``
3257

@@ -38,31 +63,59 @@ php artisan lrd:generate
3863

3964
Docs HTML is generated inside ``docs/``.
4065

41-
## Design pattern
66+
# Design pattern
4267

4368
In order for this plugin to work, you need to follow the design pattern by injecting the request class inside the controller.
4469
For extra documentation you can use markdown inside your controller method as well.
4570

4671
![Design pattern](https://imgur.com/yXjq3jp.png)
4772

48-
### Screenshots
73+
# Screenshots
4974

50-
Generated API documentation
75+
**Generated API documentation**
5176

5277
![Preview](https://imgur.com/8DvBBhs.png)
5378

54-
Try API
79+
**Try API**
5580

5681
![Preview](https://imgur.com/kcKVSzm.png)
5782

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+
```
58111

59-
## Testing
112+
# Testing
60113

61114
```bash
62115
./vendor/bin/phpunit
63116
```
64117

65-
## Linting
118+
# Linting
66119

67120
```bash
68121
./vendor/bin/phpcs --standard=phpcs.xml --extensions=php --ignore=tests/migrations config/ src/
@@ -75,11 +128,12 @@ Fixing lints
75128
./vendor/bin/php-cs-fixer fix config/
76129
```
77130

78-
## Changelog
131+
# Changelog
79132

80133
- Initial Release
81134
- v1.9 Added improvements such as status code, response headers, custom request headers and fixed issues reported by users
82135
- v1.10 Show PHP memory usage, gzip encoding fix
83136
- v1.12 Bug Fix of id, and Laravel 9 support
84137
- v1.13 Laravel 9 support
138+
- v1.14 ``__invoke()`` support
85139

src/LaravelRequestDocs.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ public function appendRequestRules(array $controllersInfo)
136136
// If your rules are not populated using this library, then fix your rule to only throw validation errors and not throw exceptions
137137
// such as 404, 500 inside the request class.
138138
// $controllersInfo[$index]['rules'] = $this->rulesByRegex($requestClassName);
139+
// throw $e;
139140
}
140141
$controllersInfo[$index]['docBlock'] = $this->lrdDocComment($reflectionMethod->getDocComment());
141142
}

0 commit comments

Comments
 (0)