PHP code example of arispati / laravel-encrypt-file

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

    

arispati / laravel-encrypt-file example snippets


use Arispati\LaravelEncryptFile\Crypt;

// set file path
$source = Storage::disk('local')->path('image.jpg');
$encrypted = Storage::disk('local')->path('encrypted.jpg');
$decrypted = Storage::disk('local')->path('decrypted.jpg');

// Encrypt the file
Crypt::encrypt($source, $encrypted);

// Decrypt the file
Crypt::decrypt($encrypted, $decrypted);