vking/laravel-notification-wxlite is a Laravel package for laravel notification wechat lite app channel.
It currently has 0 GitHub stars and 0 downloads on Packagist.
Install it with composer require vking/laravel-notification-wxlite.
Discover more Laravel packages by vking
or browse all Laravel packages to compare alternatives.
Last updated
public $data;
public function __construct($data)
{
//
$this->data=$data;
}
public function via($notifiable)
{
return [WxliteChannel::class];
}
#添加 toWechat 函数,名称必须是 toWechat
public function toWechat($notifiable){
return new WxliteMessage(
"订阅消息id",
[
'name1' => [
'value' => $name1,
],
'name1' => [
'value' => $name1,
],
],
"小程序的页面地址"
);
}
use Notifiable;
public function routeNotificationForWechat(){
return $this->openid;
}
#case 1,单发
$wechat=wechat::find('openid');
$wechat->notify(new YouerNotice($一些数据));
#case 2,发给多人
$wechats=wechat::where(...)->get()
Notification::send($wechats,new YouerNotice($一些数据));
祝好运
overtrue/laravel-wechat(这么完美的微信框架,做微信都离不开吧) 以及各种laravel-notification-channels的代码参考学习 等等前人