Bright-Tech / laravel-aliyunoss-service by SamXiao

微信SDK laravel
1,982
0
4
Package Data
Maintainer Username: SamXiao
Maintainer Contact: xiao.yanqi@bright-tech.cn (BrightTech)
Package Create Date: 2016-09-02
Package Last Update: 2017-10-23
Language: PHP
License: GNU GENERAL PUBLIC LICENSE
Last Refreshed: 2024-12-11 15:11:32
Package Statistics
Total Downloads: 1,982
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 4
Total Forks: 1
Total Open Issues: 0

Laravel Wechat Service

Laravel 专用微信SDK服务

##安装

推荐使用 composer 进行安装.

你可以运行以下命令

php composer.phar require bright-tech/laravel-wechat-service

或向你的 composer.json 文件的 require 项中增加

"bright-tech/laravel-wechat-service": "*"

接下来,执行

php artisan vendor:publish

wechat.php 文件部署到config文件夹下。

之后需要将 WechatServiceProvider 加入 config\app.phpproviders

'providers' => [
    ...
    bright_tech\laravel\wechat\WechatServiceProvider::class,
]

最后增加 alias

'aliases' => [
    ...
    'Wechat' => bright_tech\laravel\wechat\WechatServiceFacade::class,
]

##使用 ###初始化

    public function getWechat( WechatService $wechatService ){
    ...
    }

###获取Access Token 本Service会自动使用系统中设置的Cache组件缓存AccessToken

    $wechatService->getAccessToken()

###发送微信请求 具体可执行的方法请参考 Wechat PHP SDK

    $wechatService->getWechatClient()->sendTemplateMessage(...);