PHP code example of ayman-elmalah / whmcs

1. Go to this page and download the library: Download ayman-elmalah/whmcs 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/ */

    

ayman-elmalah / whmcs example snippets


php artisan vendor:publish --provider=AymanElmalah\Whmcs\WhmcsServiceProvider

 WHMCS_URL='http://yourdomain.com/_PASSWORD='password'
 

use Whmcs;
 // curl request
 public function action() {
     $post_fields = ['userid' => $CLIENT_ID', 'responsetype' => 'json'];
     $action = 'GetInvoices';
     $whmcs = Whmcs::curl($action, $post_fields);

     return $whmcs;
 }
   
 // localApi request
 public function action() {
     $post_fields = ['userid' => $CLIENT_ID', 'responsetype' => 'json'];
     $action = 'GetInvoices';
     $whmcs = Whmcs::localApi($action, $post_fields);
    
     return $whmcs;
 }