123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- <?php
- /*
- * This file is part of the overtrue/laravel-wechat.
- *
- * (c) overtrue <i@overtrue.me>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
- return [
- /*
- * 默认配置,将会合并到各模块中
- */
- 'defaults' => [
- /*
- * 指定 API 调用返回结果的类型:array(default)/collection/object/raw/自定义类名
- */
- 'response_type' => 'array',
- /*
- * 使用 Laravel 的缓存系统
- */
- 'use_laravel_cache' => true,
- /*
- * 日志配置
- *
- * level: 日志级别,可选为:
- * debug/info/notice/warning/error/critical/alert/emergency
- * file:日志文件位置(绝对路径!!!),要求可写权限
- */
- 'log' => [
- 'default' => env('APP_DEBUG', false) ? 'dev' : 'prod', // 默认使用的 channel,生产环境可以改为下面的 prod
- 'channels' => [
- // 测试环境
- 'dev' => [
- 'driver' => 'single',
- 'path' => '/tmp/easywechat.log',
- 'level' => 'debug',
- ],
- // 生产环境
- 'prod' => [
- 'driver' => 'daily',
- 'path' => '/tmp/easywechat.log',
- 'level' => 'info',
- ],
- ],
- ],
- ],
- /*
- * 路由配置
- */
- 'route' => [
- /*
- * 开放平台第三方平台路由配置
- */
- // 'open_platform' => [
- // 'uri' => 'serve',
- // 'action' => Overtrue\LaravelWeChat\Controllers\OpenPlatformController::class,
- // 'attributes' => [
- // 'prefix' => 'open-platform',
- // 'middleware' => null,
- // ],
- // ],
- ],
- /*
- * 公众号
- */
- 'official_account' => [
- 'default' => [
- 'app_id' => env('WECHAT_OFFICIAL_ACCOUNT_APPID', 'wx5eeae5f7b832b782'), // AppID
- // 'app_id' => 'wx5eeae5f7b832b782', // AppID
- 'secret' => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', 'c985397f81f28e83830a0bd1cc7e6788'), // AppSecret
- // 'secret' => 'c985397f81f28e83830a0bd1cc7e6788', // AppSecret
- 'token' => env('WECHAT_OFFICIAL_ACCOUNT_TOKEN', 'fsdkDLlffeTg3RozsnreoTiEe'), // Token
- // 'token' => 'fsdkDLlffeTg3RozsnreoTiEe', // Token
- 'aes_key' => env('WECHAT_OFFICIAL_ACCOUNT_AES_KEY', 'aiaPI44r3GnYt1jDaaGthfgrFU56tintbJB7aOpux6T'), // EncodingAESKey
- // 'aes_key' => 'aiaPI44r3GnYt1jDaaGthfgrFU56tintbJB7aOpux6T', // EncodingAESKey
- /*
- * OAuth 配置
- *
- * scopes:公众平台(snsapi_userinfo / snsapi_base),开放平台:snsapi_login
- * callback:OAuth授权完成后的回调页地址(如果使用中间件,则随便填写。。。)
- */
- // 'oauth' => [
- // 'scopes' => array_map('trim', explode(',', env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_SCOPES', 'snsapi_userinfo'))),
- // 'callback' => env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_CALLBACK', '/examples/oauth_callback.php'),
- // ],
- ],
- ],
- /*
- * 开放平台第三方平台
- */
- // 'open_platform' => [
- // 'default' => [
- // 'app_id' => env('WECHAT_OPEN_PLATFORM_APPID', ''),
- // 'secret' => env('WECHAT_OPEN_PLATFORM_SECRET', ''),
- // 'token' => env('WECHAT_OPEN_PLATFORM_TOKEN', ''),
- // 'aes_key' => env('WECHAT_OPEN_PLATFORM_AES_KEY', ''),
- // ],
- // ],
- /*
- * 小程序
- */
- 'mini_program' => [
- 'default' => [
- 'app_id' => env('WECHAT_MINI_PROGRAM_APPID', ''),
- 'secret' => env('WECHAT_MINI_PROGRAM_SECRET', ''),
- 'token' => env('WECHAT_MINI_PROGRAM_TOKEN', ''),
- 'aes_key' => env('WECHAT_MINI_PROGRAM_AES_KEY', ''),
- ],
- ],
- /*
- * 微信支付
- */
- 'payment' => [
- 'default' => [
- 'sandbox' => env('WECHAT_PAYMENT_SANDBOX', false),
- 'app_id' => env('WECHAT_MINI_PROGRAM_APPID', ''),
- 'mch_id' => env('WECHAT_MINI_PROGRAM_PAY_MCH_ID', ''),
- 'key' => env('WECHAT_MINI_PROGRAM_PAY_MCH_KEY', ''),
- 'cert_path' => '', // XXX: 绝对路径!!!!
- 'key_path' => '', // XXX: 绝对路径!!!!
- 'notify_url' => env('APP_URL') . '/api/payments/wechat-notify', // 默认支付结果通知地址
- ],
- // ...
- ],
- /*
- * 企业微信
- */
- // 'work' => [
- // 'default' => [
- // 'corp_id' => 'xxxxxxxxxxxxxxxxx',
- // 'agent_id' => 100020,
- // 'secret' => env('WECHAT_WORK_AGENT_CONTACTS_SECRET', ''),
- // //...
- // ],
- // ],
- ];
|