PHP code example of brainstud / file-vault

1. Go to this page and download the library: Download brainstud/file-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/ */

    

brainstud / file-vault example snippets


php artisan vendor:publish --provider="Brainstud\FileVault\FileVaultServiceProvider"
 php
FileVault::encrypt('file.txt');
 php
FileVault::disk('s3')->encrypt('file.txt');
 php
FileVault::encrypt('file.txt', 'encrypted.txt');
 php
FileVault::decrypt('file.txt.enc');
 php
FileVault::decrypt('encrypted.txt');
 php
FileVault::disk('s3')->decrypt('file.txt.enc');
 php
FileVault::decrypt('encrypted.txt', 'decrypted.txt');
 php
return response()->streamDownload(function () {
    FileVault::streamDecrypt('file.txt')
}, 'laravel-readme.md');
 php
FileVault::key($encryptionKey)->encrypt('file.txt');
 php
$encryptionKey = FileVault::generateKey();