This commit is contained in:
2025-07-04 10:26:02 +05:00
parent 647979fdef
commit cfcfdefc36
2 changed files with 18 additions and 0 deletions

View File

@@ -31,6 +31,23 @@ class AlertController extends Controller
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
*