May be the most beautiful Wechat SDK till now.Laravel 5 extension package: overtrue/laravel-wechat
We discuss @ QQ Group:319502940. Welcome to join us! ^^
There are lots of Wechat SDKs around world, but no one can satisfied me, cause I want a SDK has the advantage below:
- Well organized & clear named classes & files;
- Hide the detail things developer needn't know;
- Beautiful method usage;
- Customized cached method;
- Meet PSR-4 standard;
- Highly abstracted Message class, avoid to merge json & xml;
Requirement:PHP >= 5.3.0
- use composer
composer require "overtrue/wechat:~2.0.*"
- Manually
Download zip or use the version you want:https://github.com/overtrue/wechat/releases
then use the autoload.php file in the package root folder:
<?php
require PATH_OF_YOUR_PROJECT . "wechat/autoload.php";
...
Basic Usage(Server Side):
<?php
use Overtrue\Wechat\Server;
$appId = 'wx3cf0f39249eb0e60';
$server = new Server($appId);
$server->on('message', function($message){
return "Hello! Welcome to see overtrue!";
});
// You can either echo or return
echo $server->serve();
See more usage in Wiki.
I highly recommended that you should read the Wechat's official documents first.
- Message Listener
- Event Listener
- Basic Message
- Picture and Text Message
- Template Message
-
Message Mass Sending(Due to the limitation of the official, it can't be used) - User and Group
- Customer Service and Message Send Back
- MultiCustomer Service and Message Relocate
- Web Authorization
- Customized Menu
- Material Management
- Store Management
- Card Management
- JSSDK
- Semantic Understanding
- Data statistics
- QR Code
- Short Links
PR is warmly welcomed,please follow the PSR standard Thank you!
MIT