3slab/vdm-healthcheck-bundle
/healthz conventions).HttpFoundation).routing.yml vs. routes/web.php)..env conventions.routing.yml integrate with Laravel’s routes/web.php?/up)?Database, Cache) be checked without custom code?.env for secrets (e.g., HEALTHCHECK_SECRET)?RouteServiceProvider).Phase 1: Basic Endpoints
routes/web.php:
Route::get('/liveness', [VdmHealthcheckBundle::class, 'liveness']);
Route::get('/readiness', [VdmHealthcheckBundle::class, 'readiness']);
config/packages/vdm_healthcheck.yaml (or .env for secrets).Phase 2: Custom Checkers
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
class DatabaseChecker implements MiddlewareInterface {
public function process(ServerRequestInterface $request, ResponseInterface $response) {
// Custom logic (e.g., DB ping)
}
}
vdm_healthcheck:
readiness_checkers:
database: App\Middleware\DatabaseChecker
Phase 3: Secret Management
.env:
VDM_HEALTHCHECK_SECRET=my_secret
SecretChecker to read from Laravel’s config.symfony/http-foundation).EventDispatcher with Laravel’s Illuminate\Events\Dispatcher.HttpFoundation requests/responses to Laravel’s Illuminate\Http.env or a scheduler.| Failure Type | Impact | Mitigation |
|---|---|---|
| Bundle route conflicts | Broken healthcheck endpoints | Prefix routes (e.g., /api/health/liveness). |
| Custom checker errors | False negatives/positives | Circuit breakers (e.g., retry logic). |
| Secret leakage | Unauthorized access to details | Use Laravel’s env + rate-limiting. |
| External dependency flakes | Readiness probe failures | Implement jitter/retry in checkers. |
| Symfony/Laravel mismatch | Runtime exceptions | Isolation layer (e.g., adapter classes). |
How can I help you explore Laravel packages today?