PHPackages                             lupennat/laravel-env-enc - 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. [Security](/categories/security)
4. /
5. lupennat/laravel-env-enc

ActiveLibrary[Security](/categories/security)

lupennat/laravel-env-enc
========================

encrypt/decrypt laravel .env

v1.0.3(1y ago)0102MITPHP

Since Jan 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Lupennat/laravel-env-enc)[ Packagist](https://packagist.org/packages/lupennat/laravel-env-enc)[ Docs](https://github.com/Lupennat/laravel-env-enc)[ RSS](/packages/lupennat-laravel-env-enc/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (3)Versions (5)Used By (0)

laravel-env-enc
===============

[](#laravel-env-enc)

[![GitHub license](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://github.com/mrgswift/laravel-encryptenv/blob/master/LICENSE)

This package allows you to Encrypt/Decrypt your .envs file in Laravel.

Install
-------

[](#install)

```
$ composer require lupennat/laravel-env-enc
```

Generate a valid key
--------------------

[](#generate-a-valid-key)

Generate a new key based on `config.app.chiper`.

```
$ php artisan lupennat:env-generate-key

nvK/Ay8HrB+3SAYnWSehUYajMqceBdpwvp45U3cYWd4=
```

**Store your key outside the laravel project.**

Encrypt/Decrypt file .env
-------------------------

[](#encryptdecrypt-file-env)

```
$ php artisan lupennat:env-encrypt
Provide a key:
 > nvK/Ay8HrB+3SAYnWSehUYajMqceBdpwvp45U3cYWd4=
Which key cipher? [AES-256-CBC]:
  [0] AES-128-CBC
  [1] AES-256-CBC
 > 1
File /xxx/.env.enc succesfully created!
```

```
$ php artisan lupennat:env-decrypt
Provide a key:
 > nvK/Ay8HrB+3SAYnWSehUYajMqceBdpwvp45U3cYWd4=
Which key cipher? [AES-256-CBC]:
  [0] AES-128-CBC
  [1] AES-256-CBC
 > 1
File /xxx/.env succesfully created!
```

Manage multiple .env
--------------------

[](#manage-multiple-env)

```
$ php artisan lupennat:env-encrypt local
Provide a key:
 > nvK/Ay8HrB+3SAYnWSehUYajMqceBdpwvp45U3cYWd4=
Which key cipher? [AES-256-CBC]:
  [0] AES-128-CBC
  [1] AES-256-CBC
 > 1
File /xxx/.env.local.enc succesfully created!
```

```
$ php artisan lupennat:env-decrypt local
Provide a key:
 > nvK/Ay8HrB+3SAYnWSehUYajMqceBdpwvp45U3cYWd4=
Which key cipher? [AES-256-CBC]:
  [0] AES-128-CBC
  [1] AES-256-CBC
 > 1
File /xxx/.env.local succesfully created!
```

```
$ cp .env.local .env
$ cp .env.prod .env
$ cp .env.xxx .env
```

Hide sensitive data
-------------------

[](#hide-sensitive-data)

add these lines in the .gitignore file

```
.env*
!.env.*.enc
```

Encrypt your env files and push on your repository.

License
-------

[](#license)

[MIT](https://github.com/Lupennat/laravel-env-enc/blob/main/LICENSE)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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 ~422 days

Total

4

Last Release

718d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6160171?v=4)[Claudio Pennati](/maintainers/lupennat)[@Lupennat](https://github.com/Lupennat)

---

Top Contributors

[![Lupennat](https://avatars.githubusercontent.com/u/6160171?v=4)](https://github.com/Lupennat "Lupennat (9 commits)")

---

Tags

laravelencryptdecryptenvhidedim

### Embed Badge

![Health badge](/badges/lupennat-laravel-env-enc/health.svg)

```
[![Health](https://phpackages.com/badges/lupennat-laravel-env-enc/health.svg)](https://phpackages.com/packages/lupennat-laravel-env-enc)
```

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k89.4M575](/packages/laravel-passport)[laravel/sail

Docker files for running a basic Laravel application.

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

The official AI SDK for Laravel.

9782.1M162](/packages/laravel-ai)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.7M64](/packages/spatie-laravel-responsecache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9742.3M121](/packages/roots-acorn)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76518.2M120](/packages/laravel-mcp)

PHPackages © 2026

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