Passed
Push — aboutme-page ( 44fc8e )
by Fèvre
06:00
created

DownloadsController::download()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 1
b 0
f 0
1
<?php
2
namespace Xetaravel\Http\Controllers;
3
4
use Symfony\Component\HttpFoundation\BinaryFileResponse;
5
6
class DownloadsController extends Controller
7
{
8
    /**
9
     * Download a file.
10
     *
11
     * @param string $fileName
12
     *
13
     * @return BinaryFileResponse
14
     */
15
    public function download($fileName)
16
    {
17
        $filePath = public_path('files/'.$fileName);
18
19
        return response()->download($filePath);
20
    }
21
}
22