Skip to content

A simple Laravel package that allows you to store and retrieve environment variables in a database. It supports optional encryption for additional security.

License

Notifications You must be signed in to change notification settings

zappzerapp/laravel-db-vault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Header

Laravel DB Vault

A simple Laravel package that allows you to store and retrieve environment variables in a database. It supports optional encryption for additional security.

Installation

composer install zappzerapp/laravel-db-vault

Usage

Retrieve values

Use the vault(string $context, string $key, mixed $default = null) helper to retrieve values from the database:

$imageSize = vault('user', 'image_size', '1280x720');

Save values

Use the vault_set(string $context, string $key, mixed $value, bool $encrypted = false) helper to store values in the database:

To save an unencrypted value:

vault_set('user', 'image_size', '1337x420');

To save an encrypted value:

vault_set('aws', 'api_key', 'secret_api_key', true);

Encryption

The stored values can be protected with the encryption option. If the parameter $encrypt parameter is set to true, the value is encrypted before being saved. The vault() helper decrypts the value automatically when it is retrieved.

Licence

This project is licensed under the MIT licence. See the LICENSE file for details.

About

A simple Laravel package that allows you to store and retrieve environment variables in a database. It supports optional encryption for additional security.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages