Download the PHP package shahghasiadil/laravel-env-validator without Composer
On this page you can find all versions of the php package shahghasiadil/laravel-env-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shahghasiadil/laravel-env-validator
More information about shahghasiadil/laravel-env-validator
Files in shahghasiadil/laravel-env-validator
Package laravel-env-validator
Short Description A Laravel package to validate environments variables configuration values and generate environments variables rules.
License MIT
Informations about the package laravel-env-validator
Laravel Env Validator
The laravel-env-validator
package provides a way to validate your .env
configuration values in a Laravel application.
Installation
-
Install via Composer:
- Publish the Configuration:
Usage
-
Generating Validation Rules from .env:
To generate validation rules based on your
.env
values:This will read your
.env
file, generate validation rules, and store them inconfig/env-validator.php
. -
Checking Env Validity:
To validate your current environment based on the generated rules:
-
Middleware:
Ensure your environment is valid on every request by adding the middleware:
Add this to your
app/Http/Kernel.php
.Add middleware to your
routes/web.php
-
Customize Validation Rules:
To add or modify validation rules, edit the
config/env-validator.php
.
Configuration
All configuration for this package is stored in the env-validator.php
config file. It contains an array of validation rules corresponding to each key in your .env
file.
Changelog
For a detailed changelog, see the CHANGELOG.
Configs
If env changes aren't working please run the following command: