epicsweb / php-opportunities
v1.0
2020-09-15 16:03 UTC
Requires
- php: >=5.6
This package is auto-updated.
Last update: 2024-09-16 01:07:12 UTC
README
此库允许将机会发送到内部用于 Code Igniter 3.x 和 Laravel
安装
使用 composer 安装此库
composer require epicsweb/php-opportunities
配置
CodeIgniter
在您的代码 igniter 应用程序文件夹中创建或编辑文件,并设置以下变量:/application/config/epicsweb.php
<?php if( !defined('BASEPATH')) exit('No direct script access allowed'); $config['op_url'] = 'YOUR_BASE_URL_API'; $config['op_token'] = 'YOUR_SECRET_TOKEN';
Laravel
在您的 .env 文件中设置
OP_URL=YOUR_BASE_URL_API;
OP_TOKEN=YOUR_SECRET_TOKEN;
用法
CodeIgniter
更改文件 /application/config/config.php
$config['composer_autoload'] = FALSE; ↓ $config['composer_autoload'] = realpath(APPPATH . '../vendor/autoload.php');
CodeIgniter & Laravel
导入库 Epicsweb\PhpOpportnities 并调用函数
添加新机会
$data = [ 'account_id' => (array) [1,2,3], // req | int | Conta EPICS ID 'name' => (string) 'Lead Name', // req 'email' => (string) 'Lead Email', // req email or telephone 'phone' => (string) '55 17 99999-8888', // req email or telephone 'message' => (string) 'Text or Html', // opt 'date_initial' => (date) 'Y-m-d' // opt ]; $opportunity = new Epicsweb\PhpOpportunities; $opportunity->send_opportunity( $data, 'post' ); //ALLOW "put" && "get"
数组数据标签
req => 'required value'
* dont use html_entities, urlencode, json_encode, and other in the array key or values
许可证
本项目采用 MIT 许可证 - 详细信息请参阅 LICENSE.md 文件