Skip to content

Commit 90c8e4c

Browse files
committed
2 parents e771504 + 9075c1f commit 90c8e4c

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11

22
# 🚀Simple Laravel Encrypt Upload File
3-
[![GitHub license](https://img.shields.io/github/license/irfaardy/raja-ongkir?style=flat-square)](https://github.com/irfaardy/raja-ongkir/blob/master/LICENSE) [![Support me](https://img.shields.io/badge/Support-Buy%20me%20a%20coffee-yellow.svg?style=flat-square)](https://www.buymeacoffee.com/OBaAofN)
3+
[![GitHub license](https://img.shields.io/github/license/irfaardy/encrypt-file-laravel?style=flat-square)](https://github.com/irfaardy/encrypt-file-laravel/blob/master/LICENSE) [![Support me](https://img.shields.io/badge/Support-Buy%20me%20a%20coffee-yellow.svg?style=flat-square)](https://www.buymeacoffee.com/OBaAofN)
4+
5+
<p>The Simple Laravel Encrypt Upload File uses the default encryption of Laravel which is implemented in upload file.<p>
46
<h3>🛠️ Installation with Composer </h3>
57

6-
composer require irfa/raja-ongkir
8+
composer require irfa/encrypt-file-laravel
79

810
>You can get Composer [ here]( https://getcomposer.org/download/)
911
@@ -45,6 +47,7 @@
4547

4648
namespace App\Http\Controllers;
4749

50+
use Filesafe;
4851
use Illuminate\Http\Request;
4952
use App\Http\Controllers\Controller;
5053

@@ -55,7 +58,8 @@
5558
{
5659
$file = $request->file('file');
5760
FileSafe::store($file);
58-
//
61+
//This is to encrypt the file before it is uploaded to the server.
62+
5963
}
6064
}
6165

@@ -66,6 +70,7 @@
6670

6771
namespace App\Http\Controllers;
6872

73+
use FileSafe;
6974
use Illuminate\Http\Request;
7075
use App\Http\Controllers\Controller;
7176

@@ -74,9 +79,9 @@
7479
7580
public function upload_file(Request $request)
7681
{
77-
$file = 'images.jpg';
82+
$file = 'encrypted_file.doc';
7883
return FileSafe::download($file);
79-
//
84+
//This is to decrypt files to be downloaded.
8085
}
8186
}
8287

config/irfa/filesafe.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
'random_filename' => true,//Generate random alnum for upload filename,
55

6-
'path' => 'uploaded/',//Location uploaded file storage/app,
6+
'path' => 'uploaded/',//Uploaded file is located in storage/app.
77

88

99

10-
];
10+
];

0 commit comments

Comments
 (0)