Mobile API Phase 2: Push notifications via Firebase Cloud Messaging
- Install kreait/firebase-php SDK
- Create PushNotificationService with 3-tier credential resolution
(system_settings → storage file → env var, graceful degradation)
- Auto-deactivate invalid/unregistered FCM tokens on send failure
- Add Push case to NotificationChannel enum
- Create 6 event listeners for push notifications:
- AttendanceMarked → notify guardians (present/absent)
- PaymentReceived → confirm payment to guardians
- InvoiceCreated → alert guardians of new invoice
- SessionCancelled → notify all group participants
- EnrollmentCreated → confirm enrollment to guardians
- EvaluationShared → notify guardians of new evaluation
- Register all listeners in EventServiceProvider (queued)
- Create NotificationController API endpoints:
- GET notifications (paginated + unread count)
- PATCH notifications/{id}/read
- POST notifications/read-all
- GET/POST notifications/preferences
- Create scheduled push commands:
- push:session-reminder (every minute, 30min before session)
- push:installment-due (daily, 1 and 3 days before due)
- Add channel_push column to notification_preferences
- Total: 20 API endpoints now live
Co-Authored-By:
Claude Opus 4.6 <noreply@anthropic.com>
Showing
| ... | @@ -7,6 +7,7 @@ | ... | @@ -7,6 +7,7 @@ |
| "license": "MIT", | "license": "MIT", | ||
| "require": { | "require": { | ||
| "php": "^8.4", | "php": "^8.4", | ||
| "kreait/firebase-php": "^8.3", | |||
| "laravel/framework": "^13.8", | "laravel/framework": "^13.8", | ||
| "laravel/sanctum": "^4.3", | "laravel/sanctum": "^4.3", | ||
| "laravel/tinker": "^3.0", | "laravel/tinker": "^3.0", | ||
| ... | ... |
This diff is collapsed.
Please register or sign in to comment