Download the PHP package ak-codehub/db-vault without Composer

On this page you can find all versions of the php package ak-codehub/db-vault. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package db-vault

AK-CodeHub/DB-Vault

A self-contained DB access-broker panel (Horizon/Filament-style) that mounts inside any Laravel 11, 12, or 13 application at a configurable domain/path, with its own auth, 2FA, SPA, and JSON API. Developers request a privilege matrix, approvers approve, and a per-request MySQL user is provisioned and auto-expired — DROP and TRIGGER can never be granted.

Requires PHP 8.2–8.5 and Laravel 11, 12, or 13.


Quick Start

Four steps get you a working panel. The compiled SPA ships with the package, so there is no npm build step.

1. Install

2. Choose the vault's storage database

The vault keeps its own vault_* tables in a separate database so it never touches your app's schema. Set one line in .env — the vault reuses your app's existing DB credentials and only changes the database name:

(You don't need to create the database yourself — the installer does it for you.)

3. Run the installer, then create your admin

db-vault:install never prompts (safe in CI / piped runs); it only sets up the schema. Creating a human admin is a separate command, db-vault:admin, which you can also run later to add more admins. Both are safe to re-run.

Non-interactive (CI): pass --name/--email/--password to db-vault:admin, or set DBVAULT_ADMIN_NAME/EMAIL/PASSWORD (install then creates the first admin from them automatically).

4. Point the vault at the database it brokers

Add these to .env, then run php artisan config:clear:

Done. Visit /vault, log in as your admin, and the request → approve → session flow works. To let approved developers open phpMyAdmin in one click, do the phpMyAdmin setup below.

Note — separation of duties: an approver cannot approve or reject their own request (you'll see "You cannot approve or reject your own request"). Use a second user with the approver or admin role to approve.

One recommended extra: schedule the expiry sweep

So expired sessions get their MySQL users dropped automatically, add to routes/console.php:


Advanced Configuration

Everything below is optional — the Quick Start covers a working install. Reach for these when you need phpMyAdmin one-click launch, a non-default database setup, or hardened deployment.

phpMyAdmin (native, under your app URL)

Clicking Open phpMyAdmin on an active session logs the developer straight in as their temporary, scoped MySQL user — password never shown. phpMyAdmin is served natively under your app's own URL at {DBVAULT_PATH}/pma (e.g. https://your-app.example.com/vault/pma) — same origin, same TLS cert, no separate port and no separate vhost.

phpMyAdmin runs as its own web-server/PHP-FPM request (it ships its own Composer dependencies, which cannot coexist inside the Laravel process), so it is served by a web-server location/<Directory> block, not a Laravel route. Only the single-use signon token exchange crosses back into the app. Because phpMyAdmin is a ~50 MB third-party application it is not bundled in this package — two commands install and wire it:

Step 1 — download phpMyAdmin onto this host

Step 2 — generate the web-server config block and paste it into your vhost

This prints a fully-resolved block (real install path, your {vault-path}/pma prefix, the signon secret, and PmaAbsoluteUri derived from APP_URL) — nothing is hardcoded and the package never writes to /etc. Paste it inside your app's existing HTTPS server {} (nginx) or <VirtualHost> (Apache) block, then reload the web server. The block carries the signon secret to signon.php as a fastcgi_param (nginx) / SetEnv (Apache), since signon.php runs outside Laravel and can't read .env.

Step 3 — set the secret in the app .env (must match the value the generated block carries), then php artisan config:clear:

Why not php artisan serve? mTLS/native phpMyAdmin need a real web server (nginx/Apache) in front — artisan serve is single-process and can't run phpMyAdmin's separate PHP request. Use it only for the panel itself in bare local dev.

Troubleshooting

Storage database options

DBVAULT_DB_DATABASE is normally the only DB var you set — the vault inherits your host's default connection and overrides just the database name. Override more only if the vault DB lives elsewhere or uses a different engine:

Leave DBVAULT_DB_DATABASE unset to share the host's default database (legacy shared-schema mode — fine for a quick trial, not recommended for production).

If you change DBVAULT_DB_* after installing, the vault_* tables were created on the old connection — re-run php artisan db-vault:install so they exist on the new one.

Request-form scoping

Read only when a developer submits a request; safe to set anytime:

mTLS, client certificates, subdomain mount

Optional hardening — see docs/scripts/:

Script Purpose
setup-nginx-mtls.sh nginx HTTPS + client-cert reverse proxy
setup-apache-mtls.sh apache equivalent

Related env: DBVAULT_DOMAIN (mount on a subdomain instead of a path), DBVAULT_MIDDLEWARE, DBVAULT_MTLS_*, DBVAULT_CA_* (issue client certs — php artisan dbvault:make-ca for a local CA). Every knob is documented in config/dbvault.php.

When each .env var is read

db-vault:install reads only the storage database vars. Everything else is read at runtime, so it can be set after install (run config:clear after editing):

Variable(s) When Purpose
DBVAULT_DB_* before install Vault storage DB (migrations land here)
DBVAULT_ADMIN_* before install (only with --no-interaction) First admin
DBVAULT_PATH / DBVAULT_DOMAIN anytime Where the panel mounts
DBVAULT_TARGET_DATABASE / DBVAULT_ALLOWED_DATABASES / DBVAULT_INTROSPECTION_CONNECTION anytime Request form
DBVAULT_BROWSABLE_TABLES / DBVAULT_RESTRICTED_TABLES anytime Table allow/deny
DBVAULT_PROVISION_* anytime Admin MySQL creds (CREATE USER / GRANT at approval)
DBVAULT_SIGNON_SECRET / DBVAULT_PMA_PATH / DBVAULT_PMA_SIGNON_URL anytime phpMyAdmin (install-pma + pma-vhost)
DBVAULT_CA_* / DBVAULT_MIDDLEWARE / DBVAULT_MTLS_* anytime Cert issuance + mTLS

Put each .env value on its own line with no trailing # comment — some dotenv parsers fold the comment into the value.


How it works

The package ships a Vue 3 SPA (resources/js, prebuilt to public/) backed by a JSON API, wired into the host app by DbVaultServiceProvider:

Provisioning against real RDS and the CloudWatch audit ingest are deliberate stubs (ProvisionerService, SecretsManagerService) for a later phase.

Development

The compiled SPA is committed, so consumers never build it. To work on the front end:

Run the test suite (Testbench host app on in-memory SQLite; covers the auth contract, scoped request submission incl. forbidden-privilege and identifier-injection refusal, install, and the approve/reject flow):

After editing any script in docs/scripts/, regenerate the embedded copies in the HTML guide with python3 docs/build.py.


All versions of db-vault with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0 || ^12.0 || ^13.0
illuminate/auth Version ^11.0 || ^12.0 || ^13.0
illuminate/database Version ^11.0 || ^12.0 || ^13.0
illuminate/console Version ^11.0 || ^12.0 || ^13.0
illuminate/routing Version ^11.0 || ^12.0 || ^13.0
aws/aws-sdk-php Version ^3.0
pragmarx/google2fa Version ^7.0 || ^8.0 || ^9.0
bacon/bacon-qr-code Version ^2.0 || ^3.0
laravel/prompts Version ^0.1.16 || ^0.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ak-codehub/db-vault contains the following files

Loading the files please wait ...