Download the PHP package sinevia/laravel-vault without Composer
On this page you can find all versions of the php package sinevia/laravel-vault. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sinevia/laravel-vault
More information about sinevia/laravel-vault
Files in sinevia/laravel-vault
Package laravel-vault
Short Description A vault implementation for Laravel
License proprietary
Homepage https://github.com/Sinevia/laravel-vault
Informations about the package laravel-vault
Laravel Vault
Vault - a secure value storage (data-at-rest) implementation for Laravel. It can be used directly, or attached to Laravel models. When attached to models it stores the values of the attributes securely in the Vault's table. The attributes in the model's table only contain the corresponding identifiers referencing the Vault's table.
Installation
Table Schema
The following schema is used for the database.
Vault | |
---|---|
Id | String, UniqueId |
Value | Long Text |
CreatedAt | DateTime |
DeletedAt | DateTime |
UpdatedAt | DateTime |
How to Use
1. Migrations
-
1.1. Add the migration file to your database/migrations directory
- 1.2. Run the migrations to create the Vault's table
2. Using Vault Directly
-
2.1 Store a value to the vault. If successful, will return the Vault id, that the value was securely stored under
- 2.2 Retrieving the value using the Vault id it was stored under, (see the example above).
3. Using Vault with Models
- 3.1. Vault Key
Create a new class app/Helpers/App with method vaultKey. The function should return a string with the key for securing your values. Do not lose your key, or you will not be able to restore your values
-
3.2. Add the VaultAttribute trait to the model
-
3.3. Specify the attributes to be used with Vault
- 3.4. Use the vaulted attributes