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.
- 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
Install via composer
composer require melihovv/laravel-env-validator
php artisan vendor:publish --provider="Melihovv\LaravelEnvValidator\ServiceProvider" --tag="config"
// config/env-validator.php
<?php
return [
'rules' => [
'APP_NAME' => 'required|string',
'APP_ENV' => 'in:local,production',
],
];
Simply run following command
php artisan config:env-validator
If you discover any security related issues, please email [email protected] instead of using the issue tracker.