1
- # 🛡️Laravel Encrypt Upload File
2
1
3
- [ ![ Scrutinizer Code Quality] ( https://scrutinizer-ci.com/g/irfaardy/encrypt-file-laravel/badges/quality-score.png?b=master )] ( https://scrutinizer-ci.com/g/irfaardy/encrypt-file-laravel/?branch=master ) [ ![ Build Status] ( https://scrutinizer-ci.com/g/irfaardy/encrypt-file-laravel/badges/build.png?b=master )] ( https://scrutinizer-ci.com/g/irfaardy/encrypt-file-laravel/build-status/master ) [ ![ Latest Stable Version] ( https://poser.pugx.org/irfa/encrypt-file-laravel/v/stable )] ( https://packagist.org/packages/irfa/encrypt-file-laravel ) [ ![ 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 )
2
+
3
+ # 🚀Simple Laravel Encrypt Upload File
4
+ [ ![ 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
5
6
<p >The Simple Laravel Encrypt Upload File uses the default encryption of Laravel which is implemented in upload file.<p >
6
7
<h3 >🛠️ Installation with Composer </h3 >
7
8
8
-
9
- ``` php
10
- composer require irfa/encrypt-file-laravel
11
- ```
9
+ composer require irfa/encrypt-file-laravel
12
10
13
11
> You can get Composer [ here] ( https://getcomposer.org/download/ )
14
12
@@ -19,24 +17,20 @@ composer require irfa/encrypt-file-laravel
19
17
20
18
<h3 >Add to config/app.php</h3 >
21
19
22
- ``` php
23
- 'providers' => [
24
- ....
25
- Irfa\FileSafe\FileSafeServiceProvider::class,
26
- ];
27
- ```
20
+ 'providers' => [
21
+ ....
22
+ Irfa\FileSafe\FileSafeServiceProvider::class,
23
+ ];
28
24
29
25
30
26
31
27
<h3 >Add to config/app.php</h3 >
32
28
33
- ``` php
34
- 'aliases' => [
35
- ....
36
- 'FileSafe' => Irfa\FileSafe\Facades\FileSafe::class,
37
-
38
- ],
39
- ```
29
+ 'aliases' => [
30
+ ....
31
+ 'FileSafe' => Irfa\FileSafe\Facades\FileSafe::class,
32
+
33
+ ],
40
34
41
35
<h2 >Publish Vendor</h2 >
42
36
@@ -50,51 +44,59 @@ composer require irfa/encrypt-file-laravel
50
44
<h2 >Example store file</h2 >
51
45
52
46
53
- ``` php
54
- <?php
55
-
56
- namespace App\Http\Controllers;
57
-
58
- use Filesafe;
59
- use Illuminate\Http\Request;
60
- use App\Http\Controllers\Controller;
61
-
62
- class FileController extends Controller
63
- {
64
-
65
- public function upload_file(Request $request)
47
+ <?php
48
+
49
+ namespace App\Http\Controllers;
50
+
51
+ use Filesafe;
52
+ use Illuminate\Http\Request;
53
+ use App\Http\Controllers\Controller;
54
+
55
+ class FileController extends Controller
66
56
{
67
- $file = $request->file('file');
68
- FileSafe::store($file);
69
- //This is to encrypt the file before it is uploaded to the server.
70
-
57
+
58
+ public function upload_file(Request $request)
59
+ {
60
+ $file = $request->file('file');
61
+ FileSafe::store($file);
62
+ //This is to encrypt the file before it is uploaded to the server.
63
+
64
+ }
71
65
}
72
- }
73
- ```
74
66
75
67
<h2 >Example download file</h2 >
76
68
77
69
78
- ``` php
79
- ...
80
- $file = 'path/to/encrypted_file.txt';
81
- return FileSafe::download($file);
82
- //decrypt file to be downloaded.
83
- ...
84
- ```
70
+ <?php
71
+
72
+ namespace App\Http\Controllers;
73
+
74
+ use FileSafe;
75
+ use Illuminate\Http\Request;
76
+ use App\Http\Controllers\Controller;
77
+
78
+ class FileController extends Controller
79
+ {
80
+
81
+ public function upload_file(Request $request)
82
+ {
83
+ $file = 'encrypted_file.txt';
84
+ return FileSafe::download($file);
85
+ //decrypt files to be downloaded.
86
+ }
87
+ }
85
88
86
89
<h3 >View Raw File</h3 >
87
90
88
- ``` php
89
- ...
90
- $file = 'encrypt_file.txt';
91
- return FileSafe::file($file)->raw();
92
- ...
93
- ```
91
+ ...
92
+ $file = 'encrypt_file.txt';
93
+ return FileSafe::file($file)->raw();
94
+ ...
94
95
95
96
<h2 >Contribution</h2 >
96
-
97
97
ENG:<br >
98
98
If you want to contribute this project and make it better, your help is very welcome.<br >
99
99
IDN:<br >
100
100
Jika Anda ingin berkontribusi dalam proyek ini dan menjadikannya lebih baik, bantuan Anda sangat kami harapkan.
101
+
102
+ ***
0 commit comments