dmytrof/push-notification-bundle
dmytrof_push_notification_web_sdk()) is Symfony2-specific and would require replacement with Laravel Blade directives or JavaScript asset management.norkunas/onesignal-php-api (v1.0.x-dev), which is abandoned (last commit ~2017). This introduces compatibility risks with modern OneSignal APIs..env + config/) would need to map manually (e.g., via service providers).norkunas/onesignal-php-api may break with OneSignal’s API changes. A modern alternative (e.g., onesignal/onesignal-php-sdk) should be evaluated.spatie/laravel-onesignal?onesignal/onesignal-php-sdk)..env + config/onesignal.php.NotificationSent).dmytrof/push-notification-bundle and norkunas/onesignal-php-api.onesignal/onesignal-php-sdk or a custom wrapper).AppServiceProvider or dedicated) to bind OneSignal client.$this->app->singleton(OneSignal::class, function ($app) {
return new OneSignal(config('onesignal.app_id'), config('onesignal.auth_key'));
});
.env:
ONESIGNAL_APP_ID=...
ONESIGNAL_AUTH_KEY=...
config/onesignal.php:
return [
'app_id' => env('ONESIGNAL_APP_ID'),
'auth_key' => env('ONESIGNAL_AUTH_KEY'),
'safari_web_id' => env('ONESIGNAL_SAFARI_WEB_ID', null),
];
addTag() with a Laravel service method or direct OneSignal API call.| Step | Task | Dependencies |
|---|---|---|
| 1 | Audit current push notification flows | None |
| 2 | Replace OneSignal SDK | Modern SDK installed |
| 3 | Migrate configs to Laravel format | .env setup |
| 4 | Build Laravel service provider | SDK integrated |
| 5 | Replace Twig with Blade/JS injection | Frontend stack |
| 6 | Implement queue jobs for async sends | Laravel Queues |
| 7 | Write tests | Service provider ready |
| 8 | Deprecate old bundle | Full migration |
OneSignal::send() examples).users with push_token column).| Failure Scenario | Mitigation |
|---|---|
| OneSignal API downtime | Implement retry logic (Laravel Queues + exponential backoff). |
| Queue worker crashes | Use supervisor to restart workers; monitor with Laravel Forge/Envoyer. |
| Invalid push tokens | Soft-delete or flag invalid tokens in DB; clean up periodically. |
| Payload size limits | Validate payloads before sending; use compression if needed. |
| Symfony2 legacy code | Deprecate old routes/services gradually; use feature flags. |
php artisan push:send --user=123).How can I help you explore Laravel packages today?