This commit is contained in:
nurmuhammet committed 2025-07-04 10:26:02 +05:00
1 parent 647979fdef
commit cfcfdefc36
2 files changed
+18

No files matched your search

+17
View File
@@ -31,6 +31,23 @@ public function index(): JsonResponse
return response()->json($this->format($alerts));
}
/**
* All alerts
*/
public function all(): JsonResponse
{
/** @var \App\Models\User */
$user = auth()->user();
/** @var \Illuminate\Database\Eloquent\Builder<Alert> */
$alerstQuery = $user->alerts();
/** @var Collection<array-key, Alert> */
$alerts = $alerstQuery->get();
return response()->json($this->format($alerts));
}
/**
* Format
*