blob / laravel-whmcs
A simple Laravel interface for interacting with the WHMCS API.
dev-master
2018-06-20 21:24 UTC
Requires
- php: >=5.5.9
- guzzlehttp/guzzle: ~6.0
This package is not auto-updated.
Last update: 2024-11-24 03:09:23 UTC
README
NOTE: This package is no longer in active development. Feel free to fork and extend it as needed.
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.*", "blob/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\Providers\WHMCSClientServiceProvider::class, WHMCS\Providers\WHMCSInvoiceServiceProvider::class, WHMCS\Providers\WHMCSMiscServiceProvider::class, WHMCS\Providers\WHMCSModuleServiceProvider::class, WHMCS\Providers\WHMCSOrderServiceProvider::class, WHMCS\Providers\WHMCSProductsServiceProvider::class, WHMCS\Providers\WHMCSQuoteServiceProvider::class, WHMCS\Providers\WHMCSTicketServiceProvider::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 PASSWORD HASHED 'hashed_password' => false, // 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 = WHMCSClient::getClientProducts($client_id, $start, $limit); return json_encode($products); });