PHPackages                             larva/laravel-wechat-notification-channel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. larva/laravel-wechat-notification-channel

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

larva/laravel-wechat-notification-channel
=========================================

This is a Laravel expansion for the wechat Push.

1.0.6(3y ago)124264MITPHP

Since Dec 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/larvacent/laravel-wechat-notification-channel)[ Packagist](https://packagist.org/packages/larva/laravel-wechat-notification-channel)[ RSS](/packages/larva-laravel-wechat-notification-channel/feed)WikiDiscussions master Synced yesterday

READMEChangelog (7)Dependencies (3)Versions (8)Used By (0)

larva/laravel-wechat-notification-channel
=========================================

[](#larvalaravel-wechat-notification-channel)

[![Packagist](https://camo.githubusercontent.com/80a85976d05aab9bc080e0c3a78a164e0e0e7ac82f985d0b83c0cc33b273ef45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c617276612f6c61726176656c2d7765636861742d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f6d61784167653d32353932303030)](https://packagist.org/packages/larva/laravel-wechat-notification-channel)[![Total Downloads](https://camo.githubusercontent.com/9a295d3641e2da49a10b87e749630cf87a2a3d9ac20d520565d85ae2290f328a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c617276612f6c61726176656c2d7765636861742d6e6f74696669636174696f6e2d6368616e6e656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/larva/laravel-wechat-notification-channel)

适用于 Laravel 的微信模板消息推送通道适配器

该扩展是对 安正超 超哥的微信扩展的补充。

安装
--

[](#安装)

```
composer require "larva/laravel-wechat-notification-channel"
```

配置
--

[](#配置)

无需配置

使用
--

[](#使用)

编写如下 通知类然后发出去就行了

```
namespace App\Models;

class User {
    public function routeNotificationForWechat(){
        return $this->wechatid;
    }

    public function routeNotificationForWechatMiniProgram(){
        return $this->wechatminiid;
    }

    public function routeNotificationForWechatSubscribe(){
        return $this->wechatminiid;
        // or
        // $notifiable->routeNotificationFor('wechatMiniProgram',$this) 通过小程序获取 不再设置此方法
    }
}
```

```
namespace App\Notifications;

use Illuminate\Notifications\Notification;

class WelcomeNotification extends Notification
{
    /**
     * Get the notification's channels.
     *
     * @param mixed $notifiable
     * @return array|string
     */
    public function via($notifiable)
    {
        return ['wechat','wechatMiniProgram'];
    }

    /**
     * Build the wechat representation of the notification.
     *
     * @param mixed $notifiable
     * @return array|false
     */
    public function toWechat($notifiable)
    {
        if (!$toUser = $notifiable->routeNotificationFor('wechat',$this)) {
            return false;
        }
        return [
            'touser' => $toUser,
            'template_id' => 'template-id',
            'page' => 'index',
            'form_id' => 'form-id',
            'data' => [
               'keyword1' => 'VALUE',
               'keyword2' => 'VALUE2',
                    // ...
            ],
        ];
    }

    /**
     * Build the MiniProgram representation of the notification.
     *
     * @param mixed $notifiable
     * @return array|false
     */
    public function toWechatMiniProgram($notifiable)
    {
        if (!$toUser = $notifiable->routeNotificationFor('wechatMiniProgram',$this)) {
            return false;
        }
        return [
            'touser' => $toUser,
            'template_id' => 'template-id',
            'page' => 'index',
            'form_id' => 'form-id',
            'data' => [
               'keyword1' => 'VALUE',
               'keyword2' => 'VALUE2',
                   // ...
            ],
        ];
    }

    /**
     * Build the WechatSubscribeChannel representation of the notification.
     *
     * @param mixed $notifiable
     * @return array|false
     */
    public function toWechatSubscribe($notifiable)
    {
        if (!$toUser = $notifiable->routeNotificationFor('wechatSubscribe',$this)) {
            return false;
        }
        return [
            'touser' => $toUser,
            'template_id' => 'template-id',
            'page' => 'pages/index/index',
            'miniprogram_state' => env('APP_DEBUG', false) ? 'trial' : 'formal',
            // 跳转小程序类型：developer 为开发版；trial为体验版；formal为正式版；默认为正式版
            'data' => [
                'name1' => 'name1',
                'thing2' => 'thing2',
                //...
            ],

        ];
    }
}
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 58.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~159 days

Recently: every ~239 days

Total

7

Last Release

1395d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/534cdb651e8c806590fa945c6b5a18f361613848e890db1349f4a9fbcae1a650?d=identicon)[xutongle](/maintainers/xutongle)

---

Top Contributors

[![xutl](https://avatars.githubusercontent.com/u/20939388?v=4)](https://github.com/xutl "xutl (10 commits)")[![xutongle](https://avatars.githubusercontent.com/u/46956076?v=4)](https://github.com/xutongle "xutongle (4 commits)")[![osindex](https://avatars.githubusercontent.com/u/4703215?v=4)](https://github.com/osindex "osindex (3 commits)")

---

Tags

laravelnotificationwechatweixinlaravelwechatLarva

### Embed Badge

![Health badge](/badges/larva-laravel-wechat-notification-channel/health.svg)

```
[![Health](https://phpackages.com/badges/larva-laravel-wechat-notification-channel/health.svg)](https://phpackages.com/packages/larva-laravel-wechat-notification-channel)
```

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
