Skip to content

Commit 9db9a4d

Browse files
authored
Update README.md
1 parent 76478c7 commit 9db9a4d

File tree

1 file changed

+51
-53
lines changed

1 file changed

+51
-53
lines changed

README.md

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
2-
31
# 🛡️Simple Laravel Encrypt Upload File
2+
43
[![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)
54

65
<p>The Simple Laravel Encrypt Upload File uses the default encryption of Laravel which is implemented in upload file.<p>
76
<h3>🛠️ Installation with Composer </h3>
87

9-
composer require irfa/encrypt-file-laravel
8+
9+
```php
10+
composer require irfa/encrypt-file-laravel
11+
```
1012

1113
>You can get Composer [ here]( https://getcomposer.org/download/)
1214
@@ -17,20 +19,24 @@
1719

1820
<h3>Add to config/app.php</h3>
1921

20-
'providers' => [
21-
....
22-
Irfa\FileSafe\FileSafeServiceProvider::class,
23-
];
22+
```php
23+
'providers' => [
24+
....
25+
Irfa\FileSafe\FileSafeServiceProvider::class,
26+
];
27+
```
2428

2529

2630

2731
<h3>Add to config/app.php</h3>
2832

29-
'aliases' => [
30-
....
31-
'FileSafe' => Irfa\FileSafe\Facades\FileSafe::class,
32-
33-
],
33+
```php
34+
'aliases' => [
35+
....
36+
'FileSafe' => Irfa\FileSafe\Facades\FileSafe::class,
37+
38+
],
39+
```
3440

3541
<h2>Publish Vendor</h2>
3642

@@ -44,59 +50,51 @@
4450
<h2>Example store file</h2>
4551

4652

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
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)
5666
{
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-
}
67+
$file = $request->file('file');
68+
FileSafe::store($file);
69+
//This is to encrypt the file before it is uploaded to the server.
70+
6571
}
72+
}
73+
```
6674

6775
<h2>Example download file</h2>
6876

6977

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 file to be downloaded.
86-
}
87-
}
78+
```php
79+
...
80+
$file = 'path/to/encrypted_file.txt';
81+
return FileSafe::download($file);
82+
//decrypt file to be downloaded.
83+
...
84+
```
8885

8986
<h3>View Raw File</h3>
9087

91-
...
92-
$file = 'encrypt_file.txt';
93-
return FileSafe::file($file)->raw();
94-
...
88+
```php
89+
...
90+
$file = 'encrypt_file.txt';
91+
return FileSafe::file($file)->raw();
92+
...
93+
```
9594

9695
<h2>Contribution</h2>
96+
9797
ENG:<br>
9898
If you want to contribute this project and make it better, your help is very welcome.<br>
9999
IDN:<br>
100100
Jika Anda ingin berkontribusi dalam proyek ini dan menjadikannya lebih baik, bantuan Anda sangat kami harapkan.
101-
102-
***

0 commit comments

Comments
 (0)