Download the PHP package zeyad82/laravel-envx without Composer
On this page you can find all versions of the php package zeyad82/laravel-envx. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zeyad82/laravel-envx
More information about zeyad82/laravel-envx
Files in zeyad82/laravel-envx
Package laravel-envx
Short Description Laravel custom env with validation
License MIT
Informations about the package laravel-envx
Laravel Envx
Laravel Envx is a custom php environment file as an array so that it can have associative and multidimensional arrays with validation rules in order to avoid any unexpected behaviour especially if there are several instances of the project.
This has been tested with laravel 5.6
and 5.7
.
Highlights
- Make sure you don't go live without all required envx.php variables and without the correct values
- Validate envx.php variables using the Laravel Validator by defining rules in config/envx-validator.php
- Custom validation rule
required_ifany
to apply rules to an atrribute if another array attribute has a given value
Usage
Just like laravel env => envx('attribute', 'default')
Installation
Via Composer:
If you don't use auto-discovery, add the service provider your config/app.php
:
Publish configuration file
This will publish config/envx-validator.php
and envx.example.php
then run
If you will have different envx.php, add envx.php
to .gitignore
in your project root
If you will use envx in config files, the only way I found is to append the follwing to bootstrap/app.php
after ExceptionHandler
Example configuration file
Example envx.php file
Screenshot
Command Line
Browser
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License for more information.