spatie/laravel-health
Monitor your Laravel app’s health by registering checks (disk space, etc.) with warning/fail thresholds. Get notified via mail or Slack when checks degrade, and extend with custom checks for proactive alerting.
The package offers a couple of controllers that can be used to check the health of your application.
The HealthCheckResultsController will display a beautiful page with all health check results. You can find more detailed information on this page here.
The SimpleHealthCheckController will return either a status of 200 for a healthy application
or 503 for a unhealthy one without exposing any sensitive information about your application.
This is particularly helpful when you want to check the readiness of a container or a pod as they infer this by the responses status code.
Route::get('health', \Spatie\Health\Http\Controllers\SimpleHealthCheckController::class);
Alternatively you can also register the HealthCheckJsonResultsController, this one will give you a detailed view of all
the checks that have been run with their status and meta data. This endpoint will also always return a status of 200 unless
something really goes wrong.
If you don't want to expose this info, you can add an auth middleware.
Route::middleware('auth')->get('health', \Spatie\Health\Http\Controllers\HealthCheckJsonResultsController::class);
How can I help you explore Laravel packages today?