PHPackages                             fr3on/laravel-drift - 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. fr3on/laravel-drift

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

fr3on/laravel-drift
===================

Pre-deploy environment validation &amp; config drift detection for Laravel applications.

0.0.1(2mo ago)1242MITPHPPHP ^8.2CI passing

Since Apr 10Pushed 2mo agoCompare

[ Source](https://github.com/fr3on/laravel-drift)[ Packagist](https://packagist.org/packages/fr3on/laravel-drift)[ RSS](/packages/fr3on-laravel-drift/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Laravel Drift
=============

[](#laravel-drift)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ee00d0fbaa82880569d53f80840b9d7a5b4b42c1607d0a8dbdae7ff8fdfdb1e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6672336f6e2f6c61726176656c2d64726966742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fr3on/laravel-drift)[![PHP Version](https://camo.githubusercontent.com/bc858ffdb83bc2ef186f3f675d24c8d5a9b5a3136a023516d71142ddcc691721/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d3737376262342e7376673f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://packagist.org/packages/fr3on/laravel-drift)[![Laravel Version](https://camo.githubusercontent.com/9e9ced5f934e2d53319e410532e182dd7c596eecfbda43e1a868c16d397cd04c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d25354531302e3025323025374325323025354531312e3025323025374325323025354531322e302d6666326432302e7376673f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://packagist.org/packages/fr3on/laravel-drift)[![GitHub Tests Action Status](https://camo.githubusercontent.com/57a671cd99d0cc78486bdfc766e8360177b126c33c8ada604ab510386b5d44c7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6672336f6e2f6c61726176656c2d64726966742f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/fr3on/laravel-drift/actions)[![Total Downloads](https://camo.githubusercontent.com/1ab4c761286006f0790650e98db621dc4584f651eb61fffda42d8b0f7baac7cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6672336f6e2f6c61726176656c2d64726966742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fr3on/laravel-drift)

**Laravel Drift** is a pre-deploy environment validation and configuration drift detection tool. It acts as a gatekeeper, comparing your `.env` against `.env.example` and running safety checks *before* your application boots.

Key Features
------------

[](#key-features)

- **No-Boot Validation**: Runs without booting the Laravel application container for maximum safety and speed.
- **Drift Detection**: Identifies missing keys in `.env` or orphan keys in `.env.example`.
- **Safety Gates**: Prevents common deployment disasters like `APP_DEBUG=true` in production or using placeholder `APP_KEY` values.
- **Extensible Rules**: Easily add your own custom validation rules.
- **CI/CD Integration**: Simple exit code contracts to block failing builds.

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

[](#installation)

You can install the package via composer:

```
composer require fr3on/laravel-drift
```

You can publish the config file with:

```
php artisan vendor:publish --tag="drift-config"
```

Usage
-----

[](#usage)

Run the drift check:

```
php artisan drift:check
```

In your CI/CD pipeline, use the `--strict` flag to treat warnings as errors:

```
php artisan drift:check --strict
```

Built-in Rules
--------------

[](#built-in-rules)

RuleDescriptionStatus`AppDebugRule`Ensures `APP_DEBUG` is false when `APP_ENV` is production.Fail`AppKeyRule`Validates presence, length, and ensures no placeholder values are used.Fail`CompletenessRule`Compares `.env` keys against `.env.example`.Fail/Warn`QueueDriverRule`Warns if `QUEUE_CONNECTION=sync` is used in production.WarnCustom Rules
------------

[](#custom-rules)

You can create custom rules by implementing the `Fr3on\Drift\Contracts\DriftRule` interface:

```
use Fr3on\Drift\Contracts\DriftRule;
use Fr3on\Drift\EnvMap;
use Fr3on\Drift\RuleResult;

class MyCustomRule implements DriftRule
{
    public function check(EnvMap $env, EnvMap $example): RuleResult
    {
        if ($env->missing('MY_REQUIRED_KEY')) {
            return RuleResult::fail('MY_REQUIRED_KEY is missing!');
        }

        return RuleResult::pass();
    }
}
```

Register your rules in `config/drift.php`.

Credits
-------

[](#credits)

- [Ahmed Mardi](https://github.com/fr3on)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance85

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

77d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/205356416?v=4)[fr3onv](/maintainers/fr3onv)[@fr3onv](https://github.com/fr3onv)

---

Top Contributors

[![fr3on](https://avatars.githubusercontent.com/u/26393383?v=4)](https://github.com/fr3on "fr3on (14 commits)")

---

Tags

configconfigurationdriftenvenvironmentfr3onlaravelphpvalidationlaravelvalidationconfigurationenvdrift

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/fr3on-laravel-drift/health.svg)

```
[![Health](https://phpackages.com/badges/fr3on-laravel-drift/health.svg)](https://phpackages.com/packages/fr3on-laravel-drift)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.1k91.3M280](/packages/laravel-horizon)[laravel/sail

Docker files for running a basic Laravel application.

1.9k199.2M1.2k](/packages/laravel-sail)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

761621.7k17](/packages/wendelladriel-laravel-validated-dto)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2422.3M6](/packages/laravel-validation-rules-credit-card)[illuminatech/validation-composite

Allows uniting several validation rules into a single one for easy re-usage

180517.4k](/packages/illuminatech-validation-composite)

PHPackages © 2026

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