Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | 3 | public function download(Request $request, Activity $activity, ModuleInstance $moduleInstance, File $file) |
|
17 | { |
||
18 | 3 | $this->authorize('file.download'); |
|
19 | |||
20 | 2 | if(Storage::exists($file->path)) { |
|
21 | 1 | return Storage::download($file->path, $file->filename, [ |
|
22 | 1 | 'X-Vapor-Base64-Encode' => 'True' |
|
23 | ]); |
||
24 | } |
||
25 | |||
26 | 1 | throw new HttpException(404, 'File not found'); |
|
27 | } |
||
42 | } |