PHPackages                             n7olkachev/envify - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. n7olkachev/envify

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

n7olkachev/envify
=================

Envify your configs with ease

2443PHP

Since Jul 17Pushed 7y ago1 watchersCompare

[ Source](https://github.com/n7olkachev/envify)[ Packagist](https://packagist.org/packages/n7olkachev/envify)[ RSS](/packages/n7olkachev-envify/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Envify [![Build Status](https://camo.githubusercontent.com/dd3ec9c20225898d73ffb1c8c000293fa10fff40eb681ac256077dd38acbfd38/68747470733a2f2f7472617669732d63692e6f72672f6e376f6c6b61636865762f656e766966792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/n7olkachev/envify)
=========================================================================================================================================================================================================================================================================================

[](#envify-)

Envify your configs with ease

Why?
----

[](#why)

I'm just tired of writing env('FOO\_BAR\_BAZ') so

Examples
--------

[](#examples)

Default Laravel config/services.php looks like:

```
return [
    'mailgun' => [
        'domain' => env('MAILGUN_DOMAIN'),
        'secret' => env('MAILGUN_SECRET'),
    ],
    'ses' => [
        'key' => env('SES_KEY'),
        'secret' => env('SES_SECRET'),
        'region' => env('SES_REGION', 'us-east-1'),
    ],
    'sparkpost' => [
        'secret' => env('SPARKPOST_SECRET'),
    ],
    'stripe' => [
        'model' => App\User::class,
        'key' => env('STRIPE_KEY'),
        'secret' => env('STRIPE_SECRET'),
    ],
];
```

With this package it is just:

```
return envify([
    'mailgun' => [
        'domain',
        'secret',
    ],
    'ses' => [
        'key',
        'secret',
        'region' => 'us-east-1',
    ],
    'sparkpost' => [
        'secret',
    ],
    'stripe' => [
        'model' => App\User::class,
        'key',
        'secret',
    ],
]);
```

And config/app.php example:

```
return [
    'name' => env('APP_NAME', 'Laravel'),
    'env' => env('APP_ENV', 'production'),
    'debug' => env('APP_DEBUG', false),
    'url' => env('APP_URL', 'http://localhost'),
];
```

Becomes

```
return envify('app', [
    'name' => 'Laravel',
    'env' => 'production',
    'debug' => false,
    'url' => 'http://localhost',
]);
```

`envify` function scan array keys and extracts appropriate values from env, so resulting arrays will be the same.

Also, you can envify just a part of your config:

```
return [
    ...
    'foo' => envify('bar', [
        'baz', // equals 'baz' => env('BAR_BAZ')
    ]),
];
```

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

[](#installation)

You can install the package via composer:

```
composer require n7olkachev/envify
```

Testing
-------

[](#testing)

```
$ composer test
```

Credits
-------

[](#credits)

- [Nikita Tolkachev](https://github.com/n7olkachev)

Sponsored by
------------

[](#sponsored-by)

Web agency based in Minsk, Belarus

License
-------

[](#license)

The MIT License (MIT)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

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

---

Top Contributors

[![n7olkachev](https://avatars.githubusercontent.com/u/3993345?v=4)](https://github.com/n7olkachev "n7olkachev (1 commits)")

### Embed Badge

![Health badge](/badges/n7olkachev-envify/health.svg)

```
[![Health](https://phpackages.com/badges/n7olkachev-envify/health.svg)](https://phpackages.com/packages/n7olkachev-envify)
```

PHPackages © 2026

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