Issues (70)

src/Http/Controllers/DownloadController.php (3 issues)

Labels
Severity
1
<?php
2
3
namespace Itstructure\MFU\Http\Controllers;
4
5
use Illuminate\Support\Facades\Storage;
6
use Itstructure\MFU\Models\Mediafile;
7
8
/**
9
 * Class DownloadController
10
 * @package Itstructure\MFU\Http\Controllers
11
 */
12
class DownloadController extends BaseController
13
{
14
    /**
15
     * @param int $id
16
     * @return \Symfony\Component\HttpFoundation\StreamedResponse
17
     */
18
    public function download(int $id)
19
    {
20
        $fileModel = Mediafile::find($id);
21
        return Storage::disk($fileModel->disk)->download($fileModel->path, $fileModel->file_name);
0 ignored issues
show
The property file_name does not seem to exist on Illuminate\Database\Eloq...gHasThroughRelationship.
Loading history...
The property disk does not seem to exist on Illuminate\Database\Eloq...gHasThroughRelationship.
Loading history...
The property path does not seem to exist on Illuminate\Database\Eloq...gHasThroughRelationship.
Loading history...
22
    }
23
}
24