/healthcheck endpoint, aligning well with modern microservices and cloud-native architectures where observability is critical. It avoids bloat while fulfilling a core operational need.symfony/flex or manual integration). Works well in Laravel if wrapped in a Laravel-specific facade or service provider.Database::connection()->getPdo() or third-party packages like spatie/laravel-health.spatie/laravel-package-tools).HEALTHCHECK_ENABLED).HealthCheckController or using middleware to modify responses./healthcheck be secured against abuse (e.g., rate-limiting, IP whitelisting) beyond security: false?Laravel Compatibility:
config/app.php under providers and aliases.AppKernel with Laravel’s service container (may need custom bootstrapping).laravel-health-check-bundle) that:
illuminate/support instead of Symfony components.HealthCheckService facade for Laravel’s DI container./healthcheck route via Laravel’s routing system.Dependencies:
doctrine/dbal is installed if not already.HttpFoundation, Routing, DependencyInjection. Laravel already includes these, reducing friction./ping endpoints, third-party tools)./health endpoints with the bundle’s /healthcheck.composer require ekreative/health-check-bundle:^1.0 --dev to avoid production conflicts.laravel-doctrine/orm). Verify connection names match (default, mysql, etc.).composer require doctrine/dbal).config/database.php connections if using non-default names.routes/web.php (or use bundle’s routes.xml via Symfony bridge).ekreative_health_check in config/services.php (or config/packages/)./healthcheck from auth in app/Http/Kernel.php or config/auth.php.200 with healthy payload, 500 on DB failures.curl http://localhost/healthcheck or Postman.composer why-not ekreative/health-check-bundle to check dependency conflicts.HealthCheckController. Document customizations for onboarding.symfony/http-foundation:^5.4).routes.xml is loaded or Laravel route is added.security: false is set for the firewall.config/services.php.APP_DEBUG=true) for detailed error logs.cache:remember layer to avoid repeated DB checks.ab -n 10000 http://localhost/healthcheck to validate latency.Cache::forever() header to reduce load balancer health-check frequency.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Database connection down | 500 response, alerts triggered |
Configure retries/exponential backoff in checks. |
| Route misconfiguration | 404 instead of health status |
Use Laravel’s Route::get() fallback. |
| Auth misconfiguration | Endpoint requires login | Explicitly exclude in Kernel.php. |
| Custom check failures | False negatives/positives | Unit test custom checks. |
| Symfony dependency conflicts | Bundle incompatibility | Use a wrapper or vendor patch. |
/healthcheck endpoint contract (e.g., JSON schema, rate limits).HealthCheckTest class to validate responses in PHPUnit.How can I help you explore Laravel packages today?