Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ovanschie authored Jul 20, 2017
1 parent 5ce2284 commit d685b24
Showing 1 changed file with 40 additions and 3 deletions.
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,57 @@ Then add the ServiceProvider to your `config/app.php` file:
]
```

## Example
## Usage

### Message
``` php
return response()->message('hello world!', 200);
```

## Result
Result

``` json
{
"message": "hello world!"
}
```
With the Http `Status Code:200 OK`
With the Http `Status Code:200`

### Error
``` php
return response()->error('Something went wrong', $statuscode = 400);
```

Result

``` json
{
"message": "Something went wrong"
}
```
With the Http `Status Code:400`

### Success
``` php
return response()->success(['some' => 'data'], $statuscode = 200);
```

Result

``` json
{
"data": {"some": "data"}
}
```
With the Http `Status Code:200`

### PDF

Creates a (downloadable) PDF response from PDF contents.

``` php
return response()->pdf($pdfData, 'filename.pdf', $download = false);
```

## Testing

Expand Down

0 comments on commit d685b24

Please sign in to comment.