Completed
Push — master ( 2e921a...62e87e )
by Freek
16s queued 11s
created

PersonalDataExportController::export()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\PersonalDataExport\Http\Controllers;
4
5
use Illuminate\Routing\Controller;
6
use Symfony\Component\HttpFoundation\StreamedResponse;
7
use Spatie\PersonalDataExport\Http\Responses\ZipDownloadResponse;
8
use Spatie\PersonalDataExport\Http\Middleware\EnsureAuthorizedToDownload;
9
use Spatie\PersonalDataExport\Http\Middleware\FiresPersonalDataExportDownloadedEvent;
10
11
class PersonalDataExportController extends Controller
12
{
13
    public function __construct()
14
    {
15
        $this->middleware(EnsureAuthorizedToDownload::class);
16
        $this->middleware(FiresPersonalDataExportDownloadedEvent::class);
17
    }
18
19
    public function export(string $zipFilename): StreamedResponse
20
    {
21
        return new ZipDownloadResponse($zipFilename);
22
    }
23
}
24