Skip to content

Commit

Permalink
Merge pull request #7 from tominon/patch-1
Browse files Browse the repository at this point in the history
Use correct controller for JSON response
  • Loading branch information
freekmurze authored Dec 7, 2021
2 parents 6cb07b3 + 338d97f commit 46811cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/viewing-results/as-json-via-an-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ title: As JSON via an API
weight: 2
---

The package contains a controller`Spatie\Health\Http\Controllers\HealthCheckResultsController` that can be used the render the latest results of all checks as JSON. Simply use that controller in your routes on any URL you desire.
The package contains a controller `Spatie\Health\Http\Controllers\HealthCheckJsonResultsController` that can be used the render the latest results of all checks as JSON. Simply use that controller in your routes on any URL you desire.

```php
use Spatie\Health\Http\Controllers\HealthCheckResultsController
use Spatie\Health\Http\Controllers\HealthCheckJsonResultsController

Route::get('health', HealthCheckResultsController::class);
Route::get('health', HealthCheckJsonResultsController::class);
```

This controller will respond with JSON to any request that accepts JSON.
Expand Down

0 comments on commit 46811cf

Please sign in to comment.