-
-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Overtrue\LaravelWechat; | ||
|
||
use Illuminate\Support\Facades\Facade as LaravelFacade; | ||
use Log; | ||
|
||
/** | ||
* @see Overtrue\Wechat\Wechat | ||
*/ | ||
class Facade extends LaravelFacade | ||
{ | ||
/** | ||
* 默认提供服务端 | ||
* | ||
* @return string | ||
*/ | ||
protected static function getFacadeAccessor() | ||
{ | ||
return 'wechat.server'; | ||
} | ||
|
||
/** | ||
* 魔术方法 | ||
* | ||
* @param string $method | ||
* @param array $args | ||
* | ||
* @return mixed | ||
*/ | ||
public function __call($method, $args) | ||
{ | ||
if (isset(static::$app["wechat.{$method}"])) { | ||
Log::warning("建议不要再统一使用 `Wechat::on()` 等形式使用,overtrue/wechat 2.x 已经改为独立服务类型来使用各模块的功能,更多请参阅文档:https://github.com/overtrue/wechat/wiki"); | ||
return static::$app["wechat.{$method}"]; | ||
} | ||
|
||
parent::__call($method, $args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
<?php | ||
return [ | ||
'appId' => 'Your app id', // 必填 | ||
'secret' => 'Your secret', // 必填 | ||
'token' => 'Your token', // 必填 | ||
'encodingAESKey' => 'Your encoding AES Key' // 加密模式需要,其它模式不需要 | ||
'use_alias' => false, | ||
'app_id' => 'YourAppId', // 必填 | ||
'secret' => 'YourSecret', // 必填 | ||
'token' => 'YourToken', // 必填 | ||
'encoding_key' => 'YourEncodingAESKey' // 加密模式需要,其它模式不需要 | ||
]; |