PHPackages                             laramicstudio/env-guard - 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. laramicstudio/env-guard

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

laramicstudio/env-guard
=======================

It lets you define a schema for your .env file — think of it like a contract. When your app boots, it checks your actual .env against that contract and fails loudly and early if something is wrong.It lets you define a schema for your .env file — think of it like a contract. When your app boots, it checks your actual .env against that contract and fails loudly and early if something is wrong.

1.60.0(2mo ago)05↓100%MITPHPPHP ^8.3CI passing

Since Mar 9Pushed 1mo agoCompare

[ Source](https://github.com/hassan402-paymentrequired/env-guard)[ Packagist](https://packagist.org/packages/laramicstudio/env-guard)[ Docs](https://github.com/laramicstudio/env-guard)[ GitHub Sponsors]()[ RSS](/packages/laramicstudio-env-guard/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (8)Versions (7)Used By (0)

[![App Screenshot](logo.png)](logo.png)

ENV-GUARD
=========

[](#env-guard)

lets you define a schema for your .env file — think of it like a contract. When your app boots, it checks your actual .env against that contract and fails loudly and early if something is wrong.

```
composer require laramicstudio/env-guard
```

You can publish the config file with:

```
php artisan vendor:publish --tag="env-guard-config"
```

If you are installing on a already existing project you can run the command

```
php artisan env:check
```

This is the contents of the published config file:

```
return [

    'log_rejections' => false,

    'log_channel' => 'stack',

    'rules' => [
        'APP_KEY' => 'required|string',
        'APP_ENV' => 'required|in:local,staging,production',
        'DB_PASSWORD' => 'required|string|min:8',
        'STRIPE_SECRET' => 'required|starts_with:sk_',
        'CACHE_TTL' => 'required|integer|min:1',
        'MAIL_PORT' => 'nullable|integer',
    ],
];
```

Usage
-----

[](#usage)

```
$envGuard = new LaramicStudio\EnvGuard();
$envGuard->validate();
```

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [hassan lateef](https://github.com/codewithhassan)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance88

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~0 days

Total

6

Last Release

60d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ad4e7134d7bf9f5a2773b31f8ff7d07b9a1b172640ab09ad181a939c604c009?d=identicon)[hassan402-paymentrequired](/maintainers/hassan402-paymentrequired)

---

Top Contributors

[![hassan402-paymentrequired](https://avatars.githubusercontent.com/u/175612412?v=4)](https://github.com/hassan402-paymentrequired "hassan402-paymentrequired (21 commits)")

---

Tags

laravellaramic studioenv-guard

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/laramicstudio-env-guard/health.svg)

```
[![Health](https://phpackages.com/badges/laramicstudio-env-guard/health.svg)](https://phpackages.com/packages/laramicstudio-env-guard)
```

###  Alternatives

[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[ziming/laravel-zxcvbn

Zxcvbn Password validation rule for Laravel

3056.7k](/packages/ziming-laravel-zxcvbn)[laravel-validation-rules/phone

Validate that a phone number is in the correct format

69355.5k](/packages/laravel-validation-rules-phone)

PHPackages © 2026

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