PHPackages                             teun/laravel-environment-config-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. teun/laravel-environment-config-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

teun/laravel-environment-config-validator
=========================================

Validate Laravel environment variables against configurable rules.

v1.0.0(4mo ago)00MITPHPPHP ^8.2CI passing

Since Feb 16Pushed 4mo agoCompare

[ Source](https://github.com/teunvanderploeg/laravel-environment-config-validator)[ Packagist](https://packagist.org/packages/teun/laravel-environment-config-validator)[ RSS](/packages/teun-laravel-environment-config-validator/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Laravel Environment Config Validator
====================================

[](#laravel-environment-config-validator)

Validate Laravel environment variables against rules you define in config.

Installation
------------

[](#installation)

```
composer require teun/laravel-environment-config-validator
```

Publish the config file:

```
php artisan vendor:publish --tag=env-validator-config
```

Configuration
-------------

[](#configuration)

Set rules in `config/env-validator.php`:

```
return [
    'preset' => 'standard', // standard | strict | custom | your-own-preset-key
    'env_file' => null, // null = runtime env, or set '.env.testing'

    'presets' => [
        'standard' => [
            // built-in default Laravel-oriented rules
        ],
        'strict' => [
            // built-in stricter production-focused rules
        ],
        'my-team' => [
            'APP_ENV' => ['required', 'in:staging,production'],
            'DB_PASSWORD' => ['required', 'string'],
        ],
    ],

    // Overrides selected preset keys. If preset=custom, this is the full ruleset.
    'rules' => [
        'APP_ENV' => ['required', 'in:local,staging,production'],
    ],

    'check_env_example' => true,
];
```

Usage
-----

[](#usage)

Run validation:

```
php artisan env:validate
```

Override preset at runtime:

```
php artisan env:validate --preset=strict
```

Validate a specific file (for example `.env.testing`):

```
php artisan env:validate --env-file=.env.testing
```

Machine-readable output:

```
php artisan env:validate --json
```

Fail CI when `.env.example` is missing required keys:

```
php artisan env:validate --strict-example
```

CI example
----------

[](#ci-example)

```
php artisan env:validate --strict-example
```

Use this command in your deployment or CI pipeline to fail early on invalid environment config.

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance75

Regular maintenance activity

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

139d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d2081a1ef16f4e51399e9c933622d1553554556a689ca6c426dbdc86c3d1d7d5?d=identicon)[teun](/maintainers/teun)

---

Tags

laravelvalidatorconfigurationenvironmentenv

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/teun-laravel-environment-config-validator/health.svg)

```
[![Health](https://phpackages.com/badges/teun-laravel-environment-config-validator/health.svg)](https://phpackages.com/packages/teun-laravel-environment-config-validator)
```

###  Alternatives

[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M203](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

762649.9k18](/packages/wendelladriel-laravel-validated-dto)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
