定制 mathiasgrimm/laravel-env-validator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mathiasgrimm/laravel-env-validator

Composer 安装命令:

composer require mathiasgrimm/laravel-env-validator

包简介

Laravel Validator for the .env file

README 文档

README

Author Latest Version Total Downloads

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

Screenshot

Browser

Screenshot

Security

If you discover any security related issues, please email mathiasgrimm@gmail.com instead of using the issue tracker.

Credits

统计信息

  • 总下载量: 59.72k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 81
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 81
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-02-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固