PHP code example of epicsweb / php-opportunities

1. Go to this page and download the library: Download epicsweb/php-opportunities library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

epicsweb / php-opportunities example snippets


 if( !defined('BASEPATH')) exit('No direct script access allowed');

$config['op_url']       = 'YOUR_BASE_URL_API';
$config['op_token']     = 'YOUR_SECRET_TOKEN';

$config['composer_autoload'] = FALSE;
↓
$config['composer_autoload'] = realpath(APPPATH . '../vendor/autoload.php');

$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 => ' use html_entities, urlencode, json_encode, and other in the array key or values
bash
composer