feat: endpoint push-debug untuk diagnosis FCM web

This commit is contained in:
Novy San87
2026-08-06 09:10:46 +07:00
parent 18a3875d2c
commit 744b1241b8
2 changed files with 11 additions and 0 deletions
@@ -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]);
}
}
+1
View File
@@ -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');
});