New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

melihovv/laravel-env-validator

Laravel Validator for the .env file
40,172 16
Install
composer require melihovv/laravel-env-validator
Latest Version:7.0.2
PHP:>=7.2
Laravel:6 · 7 · 8
Older releases:5
License:MIT
Last Updated:Mar 11, 2022
Links: GitHub  ·  Packagist
Maintainer: melihovv

Laravel Env Validator

GitHub Workflow Status styleci

Packagist Packagist Packagist

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

Install via composer

composer require melihovv/laravel-env-validator

Publish configuration file

php artisan vendor:publish --provider="Melihovv\LaravelEnvValidator\ServiceProvider" --tag="config"

Example configuration file

// config/env-validator.php
<?php

return [
    'rules' => [
        'APP_NAME' => 'required|string',
        'APP_ENV'  => 'in:local,production',
    ],
];

Usage

Simply run following command

php artisan config:env-validator

Security

If you discover any security related issues, please email amelihovv@ya.ru instead of using the issue tracker.

Credits

Related Packages

lionix/envclient

Manage and validate Laravel environment variables with artisan commands, validat...

21,701 16
claraleigh/naughty-username

Validate that a username is not a naughty one

24,243 0
cohensive/validation

Extra functionality for Laravel 5 Validator.

13,938 14
jedrzej/validator-extended-syntax

Laravel 4/5 package that adds validator negation to Laravel's validation module

11,595 3
shin1x1/laravel-validator-builder

Laravel 4 Validator builder

7,436 2

Version History

Version Released PHP Laravel License
7.0.2 >=7.2 ^6.0|^7.0|^8.0 MIT
7.0.1 >=7.2 ^6.0|^7.0 MIT
7.0 >=7.2 ^6.0|^7.0 MIT
6.0 >=7.2 ^6.0 MIT
5.8.0 >=7.0 ~5.5.0|~5.6.0|~5.7.0|~5.8.0 MIT