PHP code example of macellan / laravel-encryption
1. Go to this page and download the library: Download macellan/laravel-encryption 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/ */
macellan / laravel-encryption example snippets
return [
/*
|--------------------------------------------------------------------------
| Encrypt Adapter Options
|--------------------------------------------------------------------------
*/
'options_encrypt' => true,
/*
|--------------------------------------------------------------------------
| Options Encryption Key.
|--------------------------------------------------------------------------
*/
'encryption_key' => env('ENCRYPTION_KEY'),
/*
|--------------------------------------------------------------------------
| Encryption Adapters
|--------------------------------------------------------------------------
*/
'adapters' => [
\Macellan\LaravelEncryption\Adapters\LocalAdapter::class,
],
];
$data = [1,2,3];
// Data Encrypt-Decrypt
$encrypt = app('encryption')->encrypt($data);
$decrypt = app('encryption')->decrypt($encrypt)->data();
// Custom Encryption Provider
$decrypt = app('encryption')->decrypt(
new CryptedData(EncryptionProvider $provider, $cryptedData);
);
shell
php artisan vendor:publish --tag="encryption"
shell
php artisan migrate
shell
php artisan encryption:list
shell
php artisan encryption:create
shell
php artisan encryption:edit
shell
php artisan encryption:remove
shell
php artisan encryption:key:generate