larva/laravel-wechat-notification-channel
A Laravel notification channel for sending notifications through WeChat. It integrates WeChat messaging into Laravel’s notification system, letting you deliver template or service messages to users alongside mail, SMS, and other channels.
Architecture fit. The package slots into Laravel's Notification subsystem as a custom channel — the pattern where a notifiable entity defines via() to include a channel key, and a channel class implements send($notifiable, Notification $notification). It almost certainly wraps EasyWeChat (overtrue/wechat) to deliver 模板消息 (template messages) to WeChat Official Accounts, translating a fluent message object into WeChat's JSON payload. Architecturally this is a thin adapter — low conceptual complexity, small surface area, one outbound dependency. It fits cleanly if your notification layer is already the abstraction you use for multi-channel delivery (mail, SMS, push); it is a poor fit if you'd be introducing Laravel Notifications solely to adopt this package, since the adapter's value is then entirely in the 100–200 lines of payload mapping.
Integration feasibility. Mechanically trivial: composer require, publish config for app ID/secret/token, add WechatChannel::class to via(), return a message object. Realistically constrained by three unknowns. First, version pinning — with no updates since 2022-07-18, the composer.json constraints likely target Laravel 8/9 and EasyWeChat 4/5, and EasyWeChat 6 was a breaking rewrite (PSR-18 HTTP client, Factory removed, Application → Wechat, renamed methods). On Laravel 10/11/12 you will likely hit dependency conflicts and need --ignore-platform-reqs hacks or a fork. Second, WeChat platform drift — Official Account template messages have been progressively narrowed in favour of 订阅消息 (subscribe messages), and IP allowlisting for access_token retrieval is mandatory, which the package may or may not document. Third, zero documentation in English and none in the README beyond a one-line description.
Technical risk. High relative to the value delivered. The code is small enough to audit in an afternoon — do that before anything else. Specific things to verify: does it cache access_token (or fetch per send, which will blow the daily quota and add ~200ms per notification)? Does it surface WeChat errcode values as exceptions or swallow them? Does it support queued notifications and retries? Is openid resolution delegated to the notifiable via routeNotificationForWechat()? Does it validate the 200k+ template data field length limits? Any of these being absent turns a "cheap integration" into a debugging exercise against an opaque Chinese-language API.
Key questions for the maintainer/vendor.
Stack fit. Viable only for Laravel ≤9 / PHP ≤8.0 shops already using EasyWeChat. On a modern stack (Laravel 11/12, PHP 8.2+) treat this as source material, not a dependency.
Migration path. Do not bind directly to the package's message classes in domain code. Introduce your own WechatNotifiable contract and a WechatMessage value object; let the package (or a fork) sit behind it. That keeps the swap to an in-house channel — roughly a day of work given the small surface area — as a config change rather than a refactor.
Compatibility. Before committing, run composer why-not against your lockfile, confirm the transitive EasyWeChat version resolves against your HTTP client (Guzzle 7 vs. PSR-18), and confirm Laravel package auto-discovery works on your version. Check whether the package's service provider registers the channel or expects manual Notification::extend().
Sequencing.
msgid.errcode distribution before expanding to all notification types.Maintenance. This is the dominant cost. One repository, 12 stars, zero dependents, no release in three years, and a single maintainer with no visible succession plan. Assume abandonment and budget ownership accordingly: ~1–2 engineer-days per year for dependency bumps, more when WeChat changes an API or EasyWeChat ships a major. Because you'll likely fork it anyway, the true cost is "we maintain a small internal package," not "we consume a vendor library."
Support. No English documentation, no issue triage cadence, no security disclosure process. Internal onboarding must be self-authored. Any production incident involving WeChat delivery routes to your team, not upstream.
Scaling. WeChat imposes hard constraints the package likely doesn't manage: access_token is global per app with a daily refresh cap, template messages have per-user frequency limits, and API calls are rate-limited (errcode 45009). At volume you need a shared token cache (Redis, with a lock to prevent thundering-herd refresh), a queue with concurrency caps, and idempotency keys so retries don't double-send. Verify the package does none of this by default — most thin channels don't.
Failure modes to design for.
errcode and the notification "succeeds" — worst case, undetectable message loss.43004): should be a non-retryable classification, not a job retry loop.via() array. Isolate WeChat sends in their own job.composer update elsewhere in the tree resolves a conflicting EasyWeChat and breaks payload construction at runtime, not build time — pin tightly.Ramp-up. A Laravel developer familiar with Notifications needs roughly half a day to integrate and one to two days to production-harden — but only after someone spends time on the WeChat platform side: registering the Official Account, getting the account verified (service accounts only support template messages), creating templates and recording their IDs, configuring IP allowlists, and obtaining openids for recipients (which requires a separate OAuth flow the package does not provide). That platform work, not the PHP, is the real critical path.
Recommendation. Score 0.28 with no dependents reflects reality: this is a viable reference implementation, not a dependency. Fork it, audit it, own it — or copy the ~150 lines of payload-mapping logic into your own channel and skip the package entirely. The opportunity score of 0.44 suggests the underlying need (unified WeChat delivery inside Laravel's notification abstraction) is real and underserved; that argues for building an internal, maintained channel rather than adopting this one.
How can I help you explore Laravel packages today?