corydemille / laravel-whmcs by corydemille
forked from nicklaw5/laravel-whmcs

A simple Laravel interface for interacting with the WHMCS API.
26
0
1
Package Data
Maintainer Username: corydemille
Package Create Date: 2016-12-09
Package Last Update: 2017-06-01
Language: PHP
License: MIT
Last Refreshed: 2024-04-29 15:02:19
Package Statistics
Total Downloads: 26
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

laravel-whmcs (WORK IN PROGRESS)

A simple Laravel interface for interacting with the WHMCS API.

Installation

To install the package, simply add the following to your Laravel installation's composer.json file:

"require": {
	"laravel/framework": "5.*",
	"corydemille/laravel-whmcs": "dev-master"
},

Run composer update to pull in the files.

Then, add the following Service Provider to your providers array in your config/app.php file:

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

From the command-line run: php artisan vendor:publish

Configuration

Open config/whmcs.php and configure the api endpoint and credentials:

return [
	// API URL
	'url'		=>	'http://url.com/whmcs/includes/api.php',
	
	// API USERNAME
	'username'	=>	'admin_user',

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

Usage

// 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);
});

WHMCS Docs

http://docs.whmcs.com/API