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(3mo ago)05MITPHPPHP ^8.3CI passing

Since Mar 9Pushed 3mo 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 3w 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

38

—

LowBetter than 83% of packages

Maintenance80

Actively maintained with recent releases

Popularity4

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

105d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/175612412?v=4)[codeWithMe](/maintainers/hassan402-paymentrequired)[@hassan402-paymentrequired](https://github.com/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

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k98.0M1.3k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.3M42](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k9.9M89](/packages/dedoc-scramble)[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M152](/packages/spatie-laravel-health)[spatie/laravel-passkeys

Use passkeys in your Laravel app

470755.5k32](/packages/spatie-laravel-passkeys)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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