Completed
Push — master ( 11a0f2...1d683d )
by Karl
10s
created

CollectionsController::download()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
1
<?php namespace JobApis\JobsToMail\Http\Controllers;
2
3
use Illuminate\Foundation\Bus\DispatchesJobs;
4
use Illuminate\Http\Request;
5
use Illuminate\Routing\Controller as BaseController;
6
use Illuminate\Foundation\Validation\ValidatesRequests;
7
use JobApis\JobsToMail\Jobs\Collections\GenerateCsv;
8
9
class CollectionsController extends BaseController
10
{
11
    use DispatchesJobs, ValidatesRequests;
12
13
    /**
14
     * Download jobs from a collection by ID
15
     */
16
    public function download(Request $request, $id)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
17
    {
18
        $path = $this->dispatchNow(new GenerateCsv($id));
19
20
        // sleep(2);
21
22
        return response()->download($path, null, ['Content-Type: text/csv']);
23
    }
24
}
25