LaravelPackages.net
Acme Inc.
Toggle sidebar
melihovv/laravel-env-validator

Laravel Validator for the .env file

40.069
16
7.0.2
About melihovv/laravel-env-validator

melihovv/laravel-env-validator is a Laravel package for laravel validator for the .env file. It currently has 16 GitHub stars and 40.069 downloads on Packagist (latest version 7.0.2). Install it with composer require melihovv/laravel-env-validator. Discover more Laravel packages by melihovv or browse all Laravel packages to compare alternatives.

Last updated

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 [email protected] instead of using the issue tracker.

Credits

Comments