ap1969 / laravel-env-validator
Laravel Validator for the .env file
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
9.0.0
2022-09-22 22:05 UTC
Requires
- php: >=7.2
- illuminate/config: ^6.0|^7.0|^8.0|^9.0
- illuminate/console: ^6.0|^7.0|^8.0|^9.0
- illuminate/support: ^6.0|^7.0|^8.0|^9.0
- illuminate/validation: ^6.0|^7.0|^8.0|^9.0
Requires (Dev)
- orchestra/testbench: ^4.0|^5.0|^6.0
- phpunit/phpunit: ^8.4|^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Laravel Env Validator is meant to validate your .env file in order to avoid any unexpected behaviour for not having properly defined some variable or value.
Cloned from https://github.com/melihovv/laravel-env-validator , which has not bee updated in years. This version updated for PHP8.1 and Laravel v9.x
Highlights
- Make sure you don't go live without all required .env variables and without the correct values
- Validate you env variables using the Laravel Validator by simple defining rules in a configuration file
- Working in teams becomes easier
Installation
Install via composer
composer require ap1969/laravel-env-validator
Publish configuration file
php artisan vendor:publish --provider="Ap1969\LaravelEnvValidator\ServiceProvider" --tag="config"
Example configuration file
// config/env-validator.php <?php return [ 'rules' => [ 'APP_NAME' => 'required|string', 'APP_ENV' => 'in:local,production', ], ];
Usage
Simply run following command
php artisan config:env-validator
Security
If you discover any security related issues, please email support@notifium.com instead of using the issue tracker.