- What does encodia/laravel-health-env-vars do?
- It is a custom check for Spatie's Laravel Health package. It verifies that every .env variable your Laravel application needs is present and correctly set. Problems are surfaced on the Laravel Health dashboard so missing or malformed config can be caught before production.
- How do I install encodia/laravel-health-env-vars?
- Install it with Composer as a development or direct dependency, depending on how you run health checks. It extends spatie/laravel-health, so that package must also be installed and configured. After installation, register the check according to the package documentation and add your required environment variable names.
- How do I configure which .env variables to check?
- You configure the environment variables that must be present and valid for your application. The check then compares the runtime environment against that list. Refer to the package README for the exact configuration key and file location.
- Does it integrate with spatie/laravel-health?
- Yes. It is built specifically as a custom check for spatie/laravel-health. Once registered, it appears alongside other health checks and reports failures on the health dashboard. It does not replace Laravel Health; it plugs into it.
- Which Laravel and PHP versions are supported?
- The 1.11.0 release adds support for Laravel 13 and PHP 8.5, according to the TPM assessment. Confirm the package's composer constraints for the full supported range, especially if you are on older Laravel or PHP versions. The release notes do not indicate breaking API changes.
- Does version 1.11.0 support Laravel 13 and PHP 8.5?
- Yes, version 1.11.0 adds Laravel 13 and PHP 8.5 support. The assessment treats this as a compatibility update rather than a feature release. Verify whether 1.11.0 also retains support for your current Laravel and PHP versions before upgrading.
- How does it behave if a required env variable is missing?
- When a required variable is missing or malformed, the health check should report a failure through Laravel Health. That makes the problem visible on the dashboard and can fail deployment or CI steps that rely on health status. The exact failure message depends on the check's implementation and configuration.
- Can I run the env var check in CI or during deployment?
- Yes, because it integrates with Laravel Health, you can run health checks in CI or deployment scripts. That lets you fail fast when required environment variables are absent. Ensure the CI or deployment environment has the same variable expectations as production.
- Is it safe to use in production, and what are the performance concerns?
- It is intended for production health monitoring and pre-deployment validation. The check reads environment values and reports status, so runtime overhead is typically small. As with any health check, review how often it runs and avoid exposing sensitive values in failure output.
- Are there alternatives, and is the package actively maintained?
- Alternatives include custom Laravel Health checks or manual env validation in deployment scripts. The package is maintained and the 1.11.0 release extends platform compatibility to Laravel 13 and PHP 8.5. Check the repository for release cadence, test matrix, and open issues before adopting it.