Conditions | 2 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function handle($request, Closure $next) |
||
11 | { |
||
12 | $optimizerChain = app(OptimizerChain::class); |
||
13 | |||
14 | collect($request->allFiles())->each(function ($file) use ($optimizerChain) { |
||
15 | if (is_array($file)) { |
||
16 | collect($file)->each(function ($media) use ($optimizerChain) { |
||
|
|||
17 | $optimizerChain->optimize($media->getPathname()); |
||
18 | }); |
||
19 | } else { |
||
20 | $optimizerChain->optimize($file->getPathname()); |
||
21 | } |
||
22 | }); |
||
23 | |||
24 | return $next($request); |
||
25 | } |
||
27 |