mathiasgrimm/laravel-env-validator
Composer 安装命令:
composer require mathiasgrimm/laravel-env-validator
包简介
Laravel Validator for the .env file
README 文档
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.
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
Laravel Env Validator is available via Composer:
{
"require": {
"mathiasgrimm/laravel-env-validator": "1.*"
}
}
Setup
Laravel
Register Service Provider
// config/app.php 'providers' => [ ... MathiasGrimm\LaravelEnvValidator\ServiceProvider::class, ... ],
Publish configuration file
php artisan vendor:publish --provider="MathiasGrimm\LaravelEnvValidator\ServiceProvider" --tag="config"
Lumen
Manually copy the configuration file
vendor/mathiasgrimm/laravel-env-validator/src/config/laravel-env-validator.php
to
config/laravel-env-validator.php
Register Service Provider in bootstrap/app.php:
... $app->register(MathiasGrimm\LaravelEnvValidator\LumenServiceProvider::class); ...
Load configuration file in bootstrap/app.php:
$app->configure('laravel-env-validator');
Example configuration file
<?php // config/laravel-env-validator.php return [ 'SOME_IMPORTANT_VARIABLE' => 'required', 'ANOTHER_IMPORTANT_ONE' => 'required|in:TYPE_A,TYPE_B,TYPE_C', ]
Screenshot
Command Line
Browser
Security
If you discover any security related issues, please email mathiasgrimm@gmail.com instead of using the issue tracker.
Credits
mathiasgrimm/laravel-env-validator 适用场景与选型建议
mathiasgrimm/laravel-env-validator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 59.72k 次下载、GitHub Stars 达 81, 最近一次更新时间为 2016 年 02 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 mathiasgrimm/laravel-env-validator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mathiasgrimm/laravel-env-validator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 59.72k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 81
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2016-02-14

