Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct controller for JSON response #7

Merged
merged 1 commit into from
Dec 7, 2021
Merged
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
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