Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Commit b5b2f06

Browse files
author
Andrey Helldar
authored
Update README.md
1 parent 2756c0b commit b5b2f06

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,30 @@ returned with code 400:
195195
}
196196
```
197197

198+
199+
```php
200+
return api_response(['data' => 'foo', 'bar' => 'baz]);
201+
```
202+
203+
returned with code 200:
204+
```json
205+
{
206+
"data": "foo",
207+
"bar": "baz"
208+
}
209+
```
210+
211+
returned with code 400:
212+
```json
213+
{
214+
"error": {
215+
"code": 400,
216+
"data":"foo"
217+
},
218+
"bar": "baz"
219+
}
220+
```
221+
198222
### Using in Laravel 5+ framework
199223

200224
To use you need to add three methods to the file `app/Exceptions/Handler.php`:

0 commit comments

Comments
 (0)