line('The introduction to the notification.') ->action('Notification Action', url('/')) ->line('Thank you for using our application!'); } /** * Get the array representation of the notification. * * @param mixed $notifiable * @return array */ public function toArray($notifiable) { return [ // ]; } /** * 发送微信小程序消息通知 * * */ public function toSendMini($notifiable) { $order = self::$order; $user = self::$user; $app = app('wechat.mini_program'); $page = 'pages/my_riding/my_riding?order='.$order->no.'&index='.$order->order_type; $data = [ 'template_id' => config('wechat.mini_program.message_template.refund'), // 所需下发的订阅模板id 'touser' => $user->auth->credential, // 接收者(用户)的 openid //'page' => $page, // 点击模板卡片后的跳转页面,仅限本小程序内的页面。支持带参数,(示例index?foo=bar)。该字段不填则模板无跳转。 'data' => [ // 模板内容,格式形如 { "key1": { "value": any }, "key2": { "value": any } } 'character_string2' => [ // 订单编号 'value' => $order->no, ], 'amount3' => [ // 退款金额 'value' => self::$money.'元', ], 'phrase1' => [ // 退款结果 'value' => self::$type, ], 'thing4' => [ // 退款进度 'value' => '已为您成功办理退款', ], ], ]; $res = $app->subscribe_message->send($data); // Log::info($res); return $res; } }