| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function __invoke($url, Request $request) |
||
| 23 | { |
||
| 24 | $query = Url::query()->whereKey($url); |
||
| 25 | |||
| 26 | $query->with([ |
||
| 27 | 'requests' => function (Relation $relation) { |
||
| 28 | $relation->latest('id'); |
||
| 29 | }, |
||
| 30 | 'requests.summary', |
||
| 31 | ]); |
||
| 32 | |||
| 33 | $url = $query->firstOrFail(); |
||
| 34 | |||
| 35 | return new Response($url); |
||
| 36 | } |
||
| 38 |