Download the PHP package encodia/laravel-health-env-vars without Composer

On this page you can find all versions of the php package encodia/laravel-health-env-vars. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-health-env-vars

.env vars check for Spatie's Laravel Health

Latest Version on Packagist GitHub Tests Action Status PHPStan GitHub Code Style Action Status Total Downloads

Laravel Health by Spatie, in addition to providing some default checks, allows you to create your own.

This package checks if all variables you need have been set in your .env file.

Starting from v1.8.0, you can also ensure a variable has been set to a certain value.

Some variables are needed in every environment; others only in specific ones. For example, you want to be sure that BUGSNAG_API_KEY has been set in your production environment, but you don't need this while developing locally.

Did anyone say "it works on my machine"?

Who has never lost several minutes before realizing that, let's say in production, something is not working because one or more variables have not been valued?

Requirements

encodia/laravel-health-env-vars requires PHP 8.0+, Laravel 8.0+.

PHP 8.1+ is required with Laravel 10.

PHP 8.2+ is required with Laravel 11 and Laravel 12.

Version compatibility

Laravel This package
12.x 1.10.0
8.x - 11.x 1.9.1

Installation

You can install the package via composer:

Usage

Register this Check just like the others:

Need to check only in a specific environment if a variable has been set?

No problem:

It's very likely that you need some variables in multiple environments, but not in all of them.

For example, you need to set BUGSNAG_API_KEY only in these environments:

but not in local, staging, demo or whatever.

You could chain multiple requireVarsForEnvironment calls but, in this case, it's better to use requireVarsForEnvironments:

Need to check if a variable has been set to a specific value?

Starting from v1.8.0, you can use requireVarsMatchValues to perform this check, regardless of the current environment.

If you need to run this check only if the current environment matches the given one(s), you can use requireVarsForEnvironment or requireVarsForEnvironments.

Examples:

⚠️ When checking values, do not store personal data, keys, tokens, etc.!

Caveats

During your deployment process, be sure to run EnvVars checks before caching your configuration!

Why? After running php artisan config:cache, any env('WHATEVER_NAME') will return null, so your EnvVars checks will fail.

Please check

[!IMPORTANT]
From version 1.9.0, when configuration is cached (e.g. via php artisan config:cache), these checks are bypassed and they return OK.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-health-env-vars with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/support Version ^8.75|^9.0|^10.0|^11.0|^12.0
spatie/laravel-health Version ^1.8
spatie/laravel-package-tools Version ^1.12.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package encodia/laravel-health-env-vars contains the following files

Loading the files please wait ....