bluetea/push-notifications
PHP library by BlueTea for sending push notifications. Provides a lightweight foundation to integrate push messaging into your application and manage notification delivery across supported providers.
OneSignalClient) into Laravel’s dependency injection (DI) system. No built-in support for Laravel’s config(), env(), or Notification channels.Guzzle <6.0) or OneSignal API v1 (now deprecated). Risk of endpoint/response format mismatches with current OneSignal APIs.ShouldQueue).Notifiable contracts).config('services.onesignal') abstraction).Notification channel would need to:
content_available payloads).laravel-notification-channels/onesignal (actively maintained, supports Laravel 8/9).mysql_*, json_encode type issues).composer.json namespace alignment).https://onesignal.com/api/v1/), which are deprecated (now https://onesignal.com/api/v1/notifications with auth changes).php-compat or laravel-legacy-faker to simulate PHP 5.4 (not recommended for production).NotificationChannel that wraps the legacy OneSignalClient (see example below).Short-Term (Band-Aid):
composer.json to target PHP 7.4+.// app/Notifications/Channels/OneSignalChannel.php
use Illuminate\Notifications\Notification;
use BlueTeaNL\PushNotifications\OneSignalClient;
class OneSignalChannel
{
public function __construct(private OneSignalClient $client) {}
public function send(Notification $notification, $notifiable)
{
$payload = $notification->toOnSignal($notifiable);
$this->client->send($payload); // Legacy method
}
}
config/notifications.php:
'channels' => [
'onesignal' => [
'driver' => 'custom',
'key' => env('ONESIGNAL_APP_KEY'),
],
],
Medium-Term (Hybrid):
laravel-notification-channels/onesignal.Long-Term (Replace):
spatie/laravel-onesignal (Laravel 5.5+).Notification channels).Illuminate\Notifications\NotificationChannel manually.Authorization: Basic header).app_id → include_player_ids).signature header for incoming events.device_ids in Laravel’s notifications table). Would need custom logic.NotificationChannel wrapper.Notification::route() and Bus queue.spatie/laravel-onesignal.Str::* methods)..env variables).Notification class examples for Laravel’s toOnSignal() method.Whoops).429 Too Many Requests) require custom retry logic.Notification::send batching).queue:work scaling.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| OneSignal API v1 Deprecation | Notifications silently fail. | Implement fallback to v2 endpoints with feature flags. |
| PHP 5.4 EOL Vulnerabilities | Remote code |
How can I help you explore Laravel packages today?