Skip to content

fix: remove Laravel's default /up health route - #221

Merged
morcen merged 1 commit into
mainfrom
fix/issue-158-remove-fake-up-health-route
Sep 11, 2026
Merged

fix: remove Laravel's default /up health route#221
morcen merged 1 commit into
mainfrom
fix/issue-158-remove-fake-up-health-route

Conversation

@morcen

@morcen morcen commented Sep 10, 2026

Copy link
Copy Markdown
Owner

What was broken

bootstrap/app.php wired up Laravel's built-in health-check convention at /up (via health: '/up'), alongside this app's own deep /health endpoint (routes/web.php) that checks the database, Redis, and the queue heartbeat.

Unlike /health, /up never checks any of that — it always returns 200 unconditionally, regardless of whether the database, Redis, or the queue worker are actually up.

None of the deployment docs (DEPLOYMENT.md, DOCKER.md, LARAVEL-CLOUD.md) mention /up at all — it's an orphaned artifact of Laravel's default scaffolding. But a platform or load balancer that probes health endpoints by Laravel's default convention (e.g. Laravel Cloud, or an orchestrator habitually configured to hit /up) could end up pointed at /up instead of /health, which would report the app healthy even during a real database/Redis/queue outage — exactly the failure mode /health was built to catch. Having two health endpoints with different semantics under the same app is a real production-outage risk.

What changed

  • Removed the health: '/up' option from bootstrap/app.php so Laravel's built-in /up route is no longer registered. /health (public, minimal) and /health/detailed (authenticated, full breakdown) remain the single source of truth for health status.
  • Added a regression test asserting GET /up now returns 404.

Testing

  • vendor/bin/pint --dirty — clean
  • composer test (full suite) — 246 passed, 1 skipped (pre-existing, unrelated)

Fixes #158


🤖 Generated with Claude Code

https://claude.ai/code/session_01MZ3rHtKtxjEQKxf7nkj2TX


Generated by Claude Code

Laravel's built-in health-check convention at /up coexisted with this
app's own deep /health endpoint (database, Redis, queue heartbeat
checks). Unlike /health, /up never checked any of that and always
returned 200 unconditionally.

None of the deployment docs (DEPLOYMENT.md, DOCKER.md,
LARAVEL-CLOUD.md) mention /up, but a platform or load balancer that
probes health endpoints by Laravel's default convention could end up
pointed at /up instead of /health, masking a real database/Redis/queue
outage that /health is specifically built to catch.

Remove the health: '/up' option from bootstrap/app.php so there is a
single, accurate health-check endpoint. Add a regression test
asserting /up is no longer registered.

Fixes #158

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MZ3rHtKtxjEQKxf7nkj2TX
@morcen
morcen merged commit 9cbc801 into main Sep 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Laravel's built-in /up health route coexists with the custom /health endpoint and always returns 200 regardless of real service health

1 participant