PHP code example of sinevia / laravel-vault

1. Go to this page and download the library: Download sinevia/laravel-vault library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sinevia / laravel-vault example snippets




class VaultTablesCreate extends Illuminate\Database\Migrations\Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up() {
        Sinevia\Vault\Models\Vault::tableCreate();
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down() {        
        Sinevia\Vault\Models\Vault::tableDelete();
    }

}

php artisan migrate

class ExampleModel {

    use \Sinevia\Vault\VaultAttributeTrait;
    
    public function getUsernameAttribute($value) {
        return $this->getVaultAttribute($value);
    }
    
    public function setUsernameAttribute($value) {
        return $this->setVaultAttribute('Username', $value);
    }
}