Package Data | |
---|---|
Maintainer Username: | melihovv |
Maintainer Contact: | amelihovv@ya.ru (Alexander Melihov) |
Package Create Date: | 2017-01-31 |
Package Last Update: | 2022-03-11 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-22 03:03:12 |
Package Statistics | |
---|---|
Total Downloads: | 38,134 |
Monthly Downloads: | 212 |
Daily Downloads: | 0 |
Total Stars: | 16 |
Total Watchers: | 2 |
Total Forks: | 4 |
Total Open Issues: | 0 |
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.
Install via composer
composer require melihovv/laravel-env-validator
Note! It is optional step if you use laravel>=5.5 with package auto discovery feature.
Add Service Provider to config/app.php
in providers
section
Melihovv\LaravelEnvValidator\ServiceProvider::class,
php artisan vendor:publish --provider="Melihovv\LaravelEnvValidator\ServiceProvider" --tag="config"
// config/laravel-env-validator.php
<?php
return [
'live_validation' => false,
'rules' => [
'SOME_IMPORTANT_VARIABLE' => 'required',
'ANOTHER_IMPORTANT_ONE' => 'required|in:TYPE_A,TYPE_B,TYPE_C',
],
];
In case you set live_validation
to false
in config, you may use artisan
command
php artisan config:env-validator
Otherwise env variables will be validated on every application start.
If you discover any security related issues, please email amelihovv@ya.ru instead of using the issue tracker.