globalxtreme / open-api
GlobalXtreme Open API 包用于 Laravel
1.0.2
2023-06-23 08:15 UTC
Requires
- php: 8.*
- globalxtreme/response: ^1.1
- guzzlehttp/guzzle: ^7.0|^7.5
- illuminate/support: ^7.0|^8.0|^9.0
This package is auto-updated.
Last update: 2024-09-23 11:02:11 UTC
README
使用 Composer 安装
要使用 Composer 安装,只需要求此包的最新版本。
composer require globalxtreme/open-api
使用
- 例如,我们将为客服到 CRM 生成新的凭据
- [CRM & 客服] 将配置发布到 config/open-api.php 文件。
php artisan vendor:publish --provider="GlobalXtreme\OpenAPI\OpenAPIServiceProvider"
- [CRM] 生成新的凭据 "php artisan open-api-credential name?"
php artisan open-api-credential customer-support
- [CRM] 将凭据复制到 "config/open-api.php"
'credentials' => [ // Copy with the same name? "customer-support" 'customer-support' => [ 'id' => env('OPEN_API_CUSTOMER_SUPPORT_ID', ''), 'key' => env('OPEN_API_CUSTOMER_SUPPORT_KEY', '') ], ]
- [CRM] 将凭据添加到 .env
OPEN_API_CUSTOMER_SUPPORT_ID=<client-id> OPEN_API_CUSTOMER_SUPPORT_KEY=<client-key>
- [客服] 将凭据复制到服务项目/客户端配置 "config/open-api.php"
'clients' => [ 'CRM' => [ 'host' => env('CRM_HOST', ''), // Server host 'client-id' => env('CRM_CLIENT_ID', ''), 'client-name' => env('CRM_CLIENT_NAME', ''), 'client-secret' => env('CRM_CLIENT_SECRET', ''), ], ]
- [客服] 将凭据添加到 .env 服务器项目/客户端
CRM_HOST=http://127.0.0.1/ CRM_CLIENT_ID=<client-id> CRM_CLIENT_NAME=<client-name> CRM_CLIENT_SECRET=<client-public-key>