We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd64a2a commit f65d35eCopy full SHA for f65d35e
app/Http/Controllers/API/Speedtest/GetLatestController.php
@@ -16,11 +16,13 @@ public function __invoke()
16
{
17
$latest = Result::query()
18
->latest()
19
- ->firstOr(function () {
20
- return response()->json([
21
- 'message' => 'No results found.',
22
- ], 404);
23
- });
+ ->first();
+
+ if (! $latest) {
+ return response()->json([
+ 'message' => 'No results found.',
24
+ ], 404);
25
+ }
26
27
return response()->json([
28
'message' => 'ok',
0 commit comments