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
*

View File

@@ -97,6 +97,7 @@ Route::middleware(['auth:sanctum', 'not_banned'])->group(function () {
// Alerts... [tested fully]
Route::get('alerts', [AlertController::class, 'index']);
Route::get('alerts-all', [AlertController::class, 'all']);
// Card orders... [tested fully]
Route::get('card-order', [CardOrderController::class, 'index']);