11/07
2014
Wallogit.com
2017 © Pedro Peláez
Add the following into composer.json under your laravel root "startrill/weixin": "dev-master", (*1)
Run the Composer update comand, (*2)
$ composer update
Add service providers, (*3)
'providers' => array(
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
...
'Startrill\Weixin\WeixinServiceProvider',
),
Add facade alias 'aliases' => array(, (*4)
'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
...
'Weixin' => 'Startrill\Weixin\Facades\Weixin',
),
Publish your weixin config and modify the config according to your weixin developement account $ php artisan config:publish startrill/weixin, (*5)
Add bellow url into weixin developement account to check valid, (*6)
http://YOURDOMAIN/wxcheck
Sample code to fetch custom menu, (*7)
http://YOURDOMAIN/wxmenu
Route::get('/wxmenu', function(){
$menu = Weixin::getInstance()->getMenu();
var_dump($menu);
});
This is free software distributed under the terms of the MIT license, (*8)
Inspired by wechat-php-sdk, (*9)