Skip to content

WHMCS API client and provider for Laravel 5, 6 ,7 and 8

License

Notifications You must be signed in to change notification settings

majidfeiz/laravel-whmcs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laravel-whmcs

A simple Laravel interface for interacting with the WHMCS API.

Installation

Install the package:

composer require sermajid/laravel-whmcs

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

'providers' => array(
	...
	sermajid\LaravelWhmcs\WhmcsServiceProvider::class,
);

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

Configuration

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

return [
    'url'	=>	env('WHMCS_URL', 'http://localhost/includes/api.php'),

    // API USERNAME
    'username'	=>	env('WHMCS_USERNAME','admin_user'),

    // API PASSWORD
    'password'	=> env('WHMCS_PASSWORD','password123'),

    // API RESPONSE TYPE
    'response_type'	=> env('WHMCS_RESPONSE_TYPE','json'),
];

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

About

WHMCS API client and provider for Laravel 5, 6 ,7 and 8

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages