Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
13 | 2 | public function __invoke(Request $request) |
|
14 | { |
||
15 | 2 | if ($uuid = $request->route('uuid', '')) { |
|
16 | // TODO: move to queue job to speed up updating? |
||
17 | /** @var TrackedChannel $tracker */ |
||
18 | 2 | $tracker = NotificationTracker::modelClass('channel')::query()->uuid($uuid)->first(); |
|
19 | 2 | if ($tracker) { |
|
|
|||
20 | 1 | $tracker->incrementOpen()->save(); |
|
21 | } |
||
22 | } |
||
23 | |||
24 | 2 | return Response::file(NotificationTracker::pixelFilePath(), [ |
|
25 | 2 | 'Cache-Control' => 'private, no-cache, no-cache=Set-Cookie, no-store, must-revalidate', |
|
26 | 2 | 'Pragma' => 'no-cache', |
|
27 | 2 | ]); |
|
30 |