zanichelli/healthcheck
A configurable health-check endpoint for Laravel applications. It runs registered checks and returns a clear JSON status, helping load balancers, uptime monitors, and deployment tools verify that your service and its dependencies are healthy.
Install it:
composer require zanichelli/healthcheck
Laravel auto-discovery should register the service provider — confirm with php artisan about or composer show zanichelli/healthcheck.
Framework compatibility: as of v1.1.7 the package supports Laravel 13 (added in PR #19). If you're on an older Laravel (10/11/12), earlier 1.1.x tags are fine — but pin the version you tested rather than floating. Check the illuminate/* constraint in composer.json after install; Composer will silently resolve to an older package tag if your framework is too new/old, so verify the installed version matches what you think you're getting.
Publish and read the config first:
php artisan vendor:publish --tag=healthcheck-config
Check the actual tag in the README; the config file is the fastest way to see which checks ship with the package, what the route path is, and what auth mechanism ("security target") it expects.
Set the security value in .env (token/key, per the README) — this package's whole purpose is a secured health endpoint, so don't leave it blank or anonymous.
Confirm the route is registered:
php artisan route:list | grep -i health
First use case — hit it locally and inspect the JSON body:
curl -i -H "X-Health-Token: $HEALTHCHECK_TOKEN" http://localhost:8000/health
You want a 200 with a per-check breakdown. That body is what you'll wire into CI, k8s probes, and uptime monitors later.
Where to look first: config/healthcheck.php → the route definition → the built-in check classes in src/. The README + those three files are the whole surface area.
K8s / Docker / LB probe
Point liveness and readiness at the route. Keep liveness shallow (app boots, container alive) and readiness deep (DB, cache reachable) — if the package only exposes one route, use separate check sets per environment or a ?checks= query if supported.
CI/CD post-deploy smoke test
curl -fsS -H "X-Health-Token: $TOKEN" "$APP_URL/health" | grep -q '"status":"ok"'
Fail the pipeline on non-2xx or on any component reporting failed. This catches migration/config drift that unit tests miss.
Secured target pattern
Combine the package's own token with standard Laravel middleware: throttle:60,1, IP allowlist, or restrict the route to the internal network via your ingress. Never expose the raw endpoint to the public internet — a health endpoint is an information leak (versions, service names, DB latency).
Custom checks
For app-specific concerns — queue backlog, writable storage/, Stripe/S3 reachability, pending migrations — implement the package's check contract (or extend its base check class). Keep each check:
failed with a reason instead of letting a 500 bubble up.Environment-aware composition Only run Redis/S3/external-API checks in environments where those services are actually configured. Wrap in config flags so local dev and CI don't report false failures. This matters more now that the package tracks Laravel releases — a matrix of app versions (12 → 13) against one health config will surface checks that only make sense on some versions.
Monitoring integration Point UptimeRobot / BetterStack / Pingdom at the endpoint and parse the JSON body for a status page. Because the body is per-check, you get component-level status for free instead of a single binary up/down.
Debug/admin route
If you need heavier diagnostics (config dump, version info, disk usage), put them behind auth + admin gate on a separate route — don't bloat the polled health endpoint.
composer.json and read the source before upgrading. Treat the README as the contract and the src/ as the tiebreaker.illuminate/support constraint moved. If you're upgrading your app to Laravel 13, upgrade the package in the same deploy and re-run your smoke test; a resolved older package tag against a new framework is a silent source of boot failures. Conversely, nothing in 1.1.7 should break a Laravel 10–12 install.php artisan config:clear route:clear locally and confirm your deploy pipeline rebuilds caches — stale caches silently mask config changes.down, tripping your orchestrator into a restart loop. Set short connection/query timeouts on checks and distinguish degraded from failed if the package supports multiple statuses.ok hides an outage. Short TTL, or bypass cache for readiness checks.phpunit.xml set the token env var and disable external checks via env overrides; then $this->get('/health') with the header in feature tests. If you support multiple Laravel versions, run these tests across the matrix — the package's own CI breadth is not a guarantee for your app's wiring.How can I help you explore Laravel packages today?