Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ public function createPost()
They will be included in the generated documentation text and example requests.

**Result:**

![](body_params.png)

### Indicating auth status
Expand Down Expand Up @@ -260,6 +261,12 @@ public function showUser(int $id)
```
For the first route above, this package will generate a set of two users then pass it through the transformer. For the last two, it will generate a single user and then pass it through the transformer.

> Note: for transformer support, you need to install the league/fractal package

```bash
composer require league/fractal
```

#### Gnerating responses automatically
If you don't specify an example response using any of the above means, this package will attempt to get a sample response by making a request to the route (a "response call"). A few things to note about response calls:
- They are done within a database transaction and changes are rolled back afterwards.
Expand Down
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
"orchestra/testbench": "3.5.* || 3.6.* || 3.7.*",
"phpunit/phpunit": "^6.0.0 || ^7.4.0",
"dingo/api": "2.0.0-alpha1",
"mockery/mockery": "^1.2.0"
"mockery/mockery": "^1.2.0",
"league/fractal": "^0.17.0"
},
"suggest": {
"league/fractal": "Required for transformers support"
},
"autoload": {
"psr-4": {
Expand Down