superzc / miniprogram
Installs: 50
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
README
This package provides additional features to the Laravel framework.
Installation
You can install the package via composer:
composer require superzc/miniprogram
Usage
修改小程序配置文件config/miniprogram.php
return [ 'wechat' => [ 'appid' => 'xxx', 'appsecret' => 'xxx', ], ];
调用类方法
use Superzc\Miniprogram\Miniprogram; use Superzc\Miniprogram\Exceptions\DefaultException as MPDefaultException; try { $miniprogram = new Miniprogram(); $result = $miniprogram->doSomething(); } catch (MPDefaultException $e) { return response()->json([ 'ret' => $e->getCode(), 'msg' => $e->getMessage(), ]); }
使用门面
use Superzc\Miniprogram\Facades\Miniprogram; try { $result = Miniprogram::doSomething(); } catch (MPDefaultException $e) { return response()->json([ 'ret' => $e->getCode(), 'msg' => $e->getMessage(), ]); }
Change log
暂无