PHPackages                             freebuu/laravel-vault - 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. freebuu/laravel-vault

ActiveLibrary[Security](/categories/security)

freebuu/laravel-vault
=====================

Laravel package for HashiCorp Vault

50PHP

Since Aug 20Pushed 2y agoCompare

[ Source](https://github.com/freebuu/laravel-vault)[ Packagist](https://packagist.org/packages/freebuu/laravel-vault)[ RSS](/packages/freebuu-laravel-vault/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Laravel Vault
=================

[](#php-laravel-vault)

Get your .env from remote (HaspiCorp Vault) on deploy

> **Warning! This is very beginning alpha version without usable realise.****Not recommended for using now**

Quickstart
----------

[](#quickstart)

### Install

[](#install)

```
composer require freebuu/laravel-vault
php artisan vendor:publish --tag=config --provider="FreeBuu\LaravelVault\LaravelVaultServiceProvider"
```

### Configure

[](#configure)

Add patches from Vault and variables to secrets in vault.php

```
'vars' => [
    'patches' => [
        '/secret/database/{env}'
    ],
    'patch_variables' => [
        'env' => 'production',
    ],
  ]
```

### Override credentials

[](#override-credentials)

Make vault.json file with Vault options - structure MUST be same as vault.php

You can override here ALL options from vault.php

```
{
  "connections": {
    "vault": {
      "host": "http://vault",
      "role_id": "your_secret_id",
      "secret_id": "your_secret_id"
    }
  }
}
```

### Use

[](#use)

```
base64 -w 0 vault.json | php artisan vault:get --stdin --b64
```

If all OK (credentials is actual and have access to secret patches), you see merged values from all patches:

```
+---------+------------+
| Key     | Value      |
+---------+------------+
| secret1 | value1     |
| secret2 | value2     |
+---------+------------+
```

- For save this in .env - add option --output=currentEnv
- For save this in .env.next - add option --output=nextEnv

### Use in CI

[](#use-in-ci)

Here is a shorthand command special from CI

- On runner, obtain a token [docs](https://learn.hashicorp.com/tutorials/vault/pattern-approle?in=vault/recommended-patterns)
- Obtain .env with that token

```
php artisan vault:ci s.JYVfe67632rRDtyf --app=my_project --env=production
```

- s.JYVfe67632rRDtyf - Vault one-time token
- my\_project - App name, set the 'app' patch variable. Optional.
- production - App env, set the 'env' patch variable. Optional.

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity21

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/46676bc740c501a0eaf765875d496f7a19db0009d0fd83f0981d0cad0b8270c2?d=identicon)[freebuu](/maintainers/freebuu)

---

Top Contributors

[![freebuu](https://avatars.githubusercontent.com/u/9998200?v=4)](https://github.com/freebuu "freebuu (32 commits)")

---

Tags

laravelvault

### Embed Badge

![Health badge](/badges/freebuu-laravel-vault/health.svg)

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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