PHP code example of thecrazybob / laravel-whmcs

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

    

thecrazybob / laravel-whmcs example snippets


'providers' => array(
	...
	WHMCS\WHMCSServiceProvider::class
);

return [
	// API URL
	'url'		=>	'http://url.com/whmcs/PI PASSWORD
	'password'	=>	'password123',

	// API RESPONSE TYPE
	'response_type'	=> 'json', // json or xml
];

// app/Http/routes.php

Route::get('/products/{client_id}', function() {

    $start = 0;
    $limit = 25;

    $products = WHMCS::getClientProducts($client_id, $start, $limit);

    return json_encode($products);
});