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

ActiveLibrary[Security](/categories/security)

mdma4d/laravel-vault
====================

Laravel HashiCorp Vault integration (secrets, database dynamic creds, encryption, hashing)

1.2.0(1mo ago)0157MITPHPPHP ^8.0CI failing

Since Sep 15Pushed 3w ago1 watchersCompare

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

READMEChangelog (3)Dependencies (7)Versions (4)Used By (0)

Laravel Vault
=============

[](#laravel-vault)

Simple Laravel configuration, dynamic database credentials, encryption and hashing backed by [HashiCorp Vault](https://www.vaultproject.io/).

Compatibility
-------------

[](#compatibility)

The package is tested against every supported major Laravel release:

LaravelPHPTestbench8.x8.0 – 8.16.x9.x8.0 – 8.27.x10.x8.1 – 8.38.x11.x8.2 – 8.39.x12.x8.2 – 8.410.x13.x8.3 – 8.511.xPHP `^8.0` is required. PHP 7.x (end of life) is not supported.

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

[](#installation)

```
composer require mdma4d/laravel-vault

```

The service provider is registered automatically via Laravel package discovery. If you have disabled discovery, add it manually to the `providers`array (or `bootstrap/providers.php` on Laravel 11+):

```
Mdma4d\Vault\VaultServiceProvider::class,
```

Configuration
-------------

[](#configuration)

Publish the configuration file if you want to customise it:

```
php artisan vendor:publish --tag=vault

```

### Configure HashiCorp Vault

[](#configure-hashicorp-vault)

Create an AppRole to access HashiCorp Vault.

Create a KV secrets engine holding your Laravel configuration:

```
{
  "app": {
    "key": "base64:cYrLP5mFSK1S5P1OQwk3tA16x2Uwkzf8Wxb5azBhcdE="
  },
  "database.connections.mysql": {
    "database": "laravel",
    "host": "mysql"
  },
  "hashing": {
    "driver": "vault",
    "old": "bcrypt"
  }
}
```

`app.key` holds the previous application key so that legacy cryptograms can still be decrypted.

Create a Transit engine for encryption and hashing, and a database engine, connection and role to obtain dynamic MySQL credentials.

### Environment variables

[](#environment-variables)

```
VAULT_ADDR=https://vault:8200
VAULT_ROLE_ID=14c64adb-80ff-1d90-da6a-9f991a76b5e0
VAULT_SECRET_ID=a3ba16c5-aec1-965b-e5b3-360acad8b799
VAULT_CONFIG=/v1/kv/laravel
VAULT_TRANSIT_PATH=/v1/laravel
VAULT_TRANSIT_KEY=key
VAULT_DATABASE=/v1/database/creds/laravel

# Optional: dedicated HMAC mount/key (falls back to the Transit settings above)
VAULT_HMAC_TRANSIT_PATH=/v1/laravel
VAULT_HMAC_KEY=key

# TLS handling
VAULT_CA_CERT_PATH=/etc/ssl/certs/vault-ca.pem   # verify against this CA
VAULT_VERIFY=false                                # or toggle verification on/off

```

If `VAULT_TOKEN` is set it is used directly; otherwise the AppRole `role_id`/`secret_id` pair is used to obtain a token.

TLS verification is handled explicitly: when `VAULT_CA_CERT_PATH` is provided the connection is verified against that CA; otherwise verification follows the `VAULT_VERIFY` flag (disabled by default to preserve the historical behaviour).

Running the tests
-----------------

[](#running-the-tests)

```
composer install
composer test            # full suite
composer test:unit       # unit tests only
composer test:feature    # feature tests only

```

The test-suite mocks all Vault HTTP traffic (via Guzzle's `MockHandler`) and Orchestra Testbench, so no running HashiCorp Vault instance or network access is required.

### With Docker

[](#with-docker)

To reproduce the full Laravel 8-13 / PHP matrix locally without installing several PHP versions, use the bundled Docker setup.

Run the whole matrix (builds one image per PHP version, then runs every row — lowest and latest dependencies):

```
docker/test-matrix.sh          # all combinations
docker/test-matrix.sh 13       # only Laravel 13 rows

```

Or run a single combination via Docker Compose:

```
# Latest deps resolvable for the composer.json constraints on PHP 8.3
docker compose run --rm test

# A specific combination
PHP_VERSION=8.2 LARAVEL='11.*' TESTBENCH='9.*' docker compose run --rm test

# Lowest dependencies
PHP_VERSION=8.0 LARAVEL='8.*' TESTBENCH='6.*' DEPS='--prefer-lowest' \
    docker compose run --rm test

```

The package source is mounted read-only, so dependencies are installed inside the container and your working copy (and its `vendor/`) is never modified.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance94

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% 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 ~336 days

Total

3

Last Release

30d ago

### Community

Maintainers

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

---

Top Contributors

[![drudiy-kfn](https://avatars.githubusercontent.com/u/278450762?v=4)](https://github.com/drudiy-kfn "drudiy-kfn (9 commits)")[![mdma4d](https://avatars.githubusercontent.com/u/13422531?v=4)](https://github.com/mdma4d "mdma4d (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.8M228](/packages/backpack-crud)[statamic/cms

The Statamic CMS Core Package

4.9k3.8M1.2k](/packages/statamic-cms)[unopim/unopim

UnoPim Laravel PIM

10.8k2.5k](/packages/unopim-unopim)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

11.3k4.0k](/packages/leantime-leantime)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

793.9k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

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