From 744b1241b825a1f25af7edcf36f0e62c05c2199d Mon Sep 17 00:00:00 2001 From: Novy San87 Date: Thu, 6 Aug 2026 09:10:46 +0700 Subject: [PATCH] feat: endpoint push-debug untuk diagnosis FCM web --- .../Controllers/Api/ParentNotificationController.php | 10 ++++++++++ routes/api.php | 1 + 2 files changed, 11 insertions(+) diff --git a/app/Http/Controllers/Api/ParentNotificationController.php b/app/Http/Controllers/Api/ParentNotificationController.php index e12b877..12d57d8 100644 --- a/app/Http/Controllers/Api/ParentNotificationController.php +++ b/app/Http/Controllers/Api/ParentNotificationController.php @@ -84,4 +84,14 @@ class ParentNotificationController extends Controller 'device_id' => $device->id, ], 201); } + + /** + * Endpoint debug: catat error sisi klien (FCM web) ke log server. + */ + public function pushDebug(Request $request): JsonResponse + { + \Illuminate\Support\Facades\Log::error('PUSH_DEBUG: '.json_encode($request->only(['step', 'error', 'detail', 'ua']))); + + return response()->json(['ok' => true]); + } } diff --git a/routes/api.php b/routes/api.php index 20dd0a5..46ab91e 100644 --- a/routes/api.php +++ b/routes/api.php @@ -40,4 +40,5 @@ Route::middleware('auth:sanctum')->prefix('parent')->group(function () { Route::get('/notifications', [ParentNotificationController::class, 'index'])->name('api.parent.notifications'); Route::get('/school-informations', [ParentSchoolInformationController::class, 'index'])->name('api.parent.school-informations'); Route::post('/devices', [ParentNotificationController::class, 'registerDevice'])->name('api.parent.devices'); + Route::post('/push-debug', [ParentNotificationController::class, 'pushDebug'])->name('api.parent.push-debug'); });