- For Laravel: run
composer require junichimura/laravel-encrypt-storage-driverin your project folder.
php artisan vendor:publish --tag=junichimura-encrypt_storage
<?php
return [
'disks' => [
'encrypt_local' => [
'driver' => 'encrypt_local', // <- driver type enctypt_local
'root' => storage_path('app'),
],
];
$plainContents = 'content';
\Storage::driver('encrypt_local')->put('/store/path', $plainContents)
$plainContents = \Storage::driver('encrypt_local')->get('/store/path');
$file = request()->file('fileName');
$file->store('/store/path', 'encrypt_local');
// or
$file->storeAs('store/path', 'filename.extention', 'encrypt_local')