medz/laravel-jpush-notification-channel
A Laravel notification channel for JPush (JiGuang Push). Send push notifications to Android, iOS, and other clients through Laravel's built-in notification system with a simple, fluent API and full support for JPush audience targeting and payload options.
Architecture fit. The package is a Laravel notification channel driver, which is a well-defined extension point in the framework. It plugs into the existing Notification::send() / via() / toJpush() contract rather than introducing a parallel dispatch mechanism, so it composes cleanly with queues, ShouldQueue, and notifiable models. That is architecturally the right seam: the channel is a thin translation layer between a Laravel notification DTO and JPush's HTTP API. The domain driver (JPush / 极光推送) is also a defensible choice if the product targets mainland China, where FCM/GCM is not viable and JPush remains a common, mature provider.
Integration feasibility. Mechanically trivial: composer require, package auto-discovery (the 5.5+ baseline implies it), publish config for app key/master secret, add a toJpush() method and a via() entry to one or more notification classes. A competent Laravel engineer can complete a working spike in under a day. The real feasibility question is version compatibility, not effort.
Technical risk. This is where the package fails as a default choice:
Key questions.
NotificationFailed event on dispatch errors, or swallow them?Stack fit. Only viable on legacy Laravel 5.5–6.x (possibly 7) with PHP 7.x. On any newer Laravel, treat it as reference source, not as a dependency. If the product is greenfield on Laravel 10/11, this package is out of scope.
Migration path. Three options, in order of preference:
app/Notifications/Channels/JpushChannel.php (or a small first-party package), depending directly on a maintained JPush SDK or a thin Guzzle client against the JPush REST API. Roughly one to three days of work, MIT license permits it, and it eliminates the abandoned-wrapper layer while keeping the SDK decision explicit.Compatibility. Before committing, produce a version matrix: Laravel version × PHP version × JPush SDK version × result of a real send to a test device on both Android and iOS. Verify that the channel method signature still satisfies the current Illuminate\Notifications\Channels\Channel expectations and that auto-discovery works on the target framework version.
Sequencing.
PushSender) with the channel as one implementation, so a provider swap (Getui, Umeng, cloud-vendor push) does not touch notification classes.Maintenance. The package has no maintainer. Budget ongoing ownership from day one: dependency bumps, PHP upgrades, JPush API changes, and credential rotation all land on us. Realistically this is a low-single-digit percentage of one engineer's time if we in-house a small channel, and materially more if we fork and track upstream drift.
Support. No vendor support path, no security advisory feed, no issue triage. Internal documentation and an owner must be named explicitly, or this becomes orphaned code the first time the owning engineer leaves.
Scaling. The notification channel model sends per notifiable, which means one JPush API call per recipient unless we batch. At meaningful volume (tens of thousands of pushes per campaign) we need JPush's batch/audience API and a queued fan-out with rate limiting and retry/backoff — none of which this package provides. Plan for queue workers, per-provider concurrency limits, and idempotency keys to avoid duplicate pushes on retry. Delivery receipts and open/click analytics require JPush's separate reporting endpoints, not the send path.
Failure modes.
NotificationFailed, pushes vanish with no signal. Instrument explicitly.Ramp-up. Very low. Any Laravel developer can read the driver in under an hour; the learning curve is JPush's audience model and reporting API, not this package. Onboarding cost is not the concern — longevity is.
How can I help you explore Laravel packages today?