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)); 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 * Format
* *
+1
View File
@@ -97,6 +97,7 @@
// Alerts... [tested fully] // Alerts... [tested fully]
Route::get('alerts', [AlertController::class, 'index']); Route::get('alerts', [AlertController::class, 'index']);
Route::get('alerts-all', [AlertController::class, 'all']);
// Card orders... [tested fully] // Card orders... [tested fully]
Route::get('card-order', [CardOrderController::class, 'index']); Route::get('card-order', [CardOrderController::class, 'index']);