melihovv/laravel-env-validator

Laravel Validator for the .env file
40,017 16
Install
composer require melihovv/laravel-env-validator
Latest Version:7.0.2
PHP:>=7.2
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

propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

40,597,346 3,019
prettus/laravel-validation

Laravel Validation Service

11,503,661 406
pixelpeter/laravel5-isocodes-validation

Laravel 5 wrapper for the IsoCodes Validation library from ronanguilloux

87,780 19
skysplit/laravel5-intl-translation

Laravel 5 package for better translation syntax using php-intl extension

106,684 10
proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rul...

2,381,793 1,141