PHPackages                             sburina/laravel-whmcs-up - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sburina/laravel-whmcs-up

ActiveLibrary[API Development](/categories/api)

sburina/laravel-whmcs-up
========================

WHMCS API client and user provider for Laravel

v2.0.0(3mo ago)261.3k13MITPHPPHP ^8.2

Since Mar 9Pushed 3mo ago8 watchersCompare

[ Source](https://github.com/sburina/laravel-whmcs-up)[ Packagist](https://packagist.org/packages/sburina/laravel-whmcs-up)[ RSS](/packages/sburina-laravel-whmcs-up/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (5)Dependencies (2)Versions (7)Used By (0)

Laravel WHMCS-UP
================

[](#laravel-whmcs-up)

[![Latest Stable Version](https://camo.githubusercontent.com/dc19f99ce8f875dbe175a7f12bfc0267562bbf1c0a488bd4f6fb8812253211ea/68747470733a2f2f706f7365722e707567782e6f72672f73627572696e612f6c61726176656c2d77686d63732d75702f762f737461626c65)](https://packagist.org/packages/sburina/laravel-whmcs-up)[![Total Downloads](https://camo.githubusercontent.com/8d0f73390ae7e92c2b4309c2bcee524552cdc38010389d427f4df65e30e4d3d4/68747470733a2f2f706f7365722e707567782e6f72672f73627572696e612f6c61726176656c2d77686d63732d75702f646f776e6c6f616473)](https://packagist.org/packages/sburina/laravel-whmcs-up)[![License](https://camo.githubusercontent.com/f49cc0f4176e78fed7cb7a75b2382cd1e625b37d2209377fbd933a27ffeae731/68747470733a2f2f706f7365722e707567782e6f72672f73627572696e612f6c61726176656c2d77686d63732d75702f6c6963656e7365)](https://packagist.org/packages/sburina/laravel-whmcs-up)

WHMCS API client, user authentication provider, and SSO integration for Laravel.

Version Compatibility
---------------------

[](#version-compatibility)

Package VersionPHPLaravelWHMCSSSO Method**2.x**&gt;= 8.210 - 138.1+CreateSsoToken**1.x**&gt;= 7.25.5 - 95.x - 8.0AutoAuthInstallation
------------

[](#installation)

### Version 2.x (Laravel 10+)

[](#version-2x-laravel-10)

```
composer require sburina/laravel-whmcs-up:^2.0
```

### Version 1.x (Laravel 5.5 - 9)

[](#version-1x-laravel-55---9)

```
composer require sburina/laravel-whmcs-up:^1.1
```

### Publish Configuration

[](#publish-configuration)

```
php artisan vendor:publish --provider="Sburina\Whmcs\WhmcsServiceProvider"
```

The package auto-discovers in Laravel 5.5+. No manual service provider registration needed.

Configuration
-------------

[](#configuration)

Set these environment variables in your `.env` file:

```
WHMCS_URL=https://your-whmcs-installation.com
WHMCS_AUTH_TYPE=api
WHMCS_API_ID=your-api-identifier
WHMCS_API_SECRET=your-api-secret
```

### Optional Variables

[](#optional-variables)

```
# Access key to bypass WHMCS IP restrictions
WHMCS_API_ACCESS_KEY=

# Admin auth (deprecated by WHMCS — use API credentials instead)
# WHMCS_AUTH_TYPE=password
# WHMCS_ADMIN_USERNAME=admin
# WHMCS_ADMIN_PASSWORD=secret

# SSL verification (default: true; set to false for self-signed dev certs)
WHMCS_VERIFY_SSL=true

# Request timeout in seconds (default: 30, v2.x only)
WHMCS_TIMEOUT=30

# Session key for storing authenticated user data
WHMCS_SESSION_USER_KEY=whmcs_user

# AutoAuth key (v1.x only — AutoAuth was removed in WHMCS 8.1)
WHMCS_AUTOAUTH_KEY=
```

See `config/whmcs.php` for all options.

Usage
-----

[](#usage)

### API Client

[](#api-client)

The package provides convenience methods with clean signatures:

```
// Get products
\Whmcs::sbGetProducts($pid, $gid, $module);

// Get clients
\Whmcs::sbGetClients($limitstart, $limitnum, $sorting, $search);
// v2.x also supports: $orderby, $status parameters

// Get client details (email or clientid required)
\Whmcs::sbGetClientsDetails($email, $clientid, $stats);

// Validate login credentials
\Whmcs::sbValidateLogin($email, $password);
```

### Magic Calls

[](#magic-calls)

Any WHMCS API action can be called directly. The method name becomes the API action:

```
\Whmcs::GetClientsProducts([
    'clientid' => 18122013
]);

\Whmcs::GetInvoice([
    'invoiceid' => 100001
]);

\Whmcs::AddOrder([
    'clientid'   => 1,
    'paymentmethod' => 'paypal',
    'pid'        => [1],
    'domain'     => ['example.com'],
]);
```

This works with any action listed in the [WHMCS API Index](https://developers.whmcs.com/api/api-index/), including custom API functions in your WHMCS installation.

### Without Facades

[](#without-facades)

```
$whmcs = app('whmcs');
$whmcs->GetInvoice(['invoiceid' => 100001]);
```

Authentication
--------------

[](#authentication)

Authenticate Laravel users against your WHMCS user base. This is useful when your Laravel app has no local user database.

### Setup

[](#setup)

**1.** In `config/auth.php`, set the provider driver:

```
'providers' => [
    'users' => [
        'driver' => 'whmcs',
    ],
],
```

The `whmcs` auth driver is registered automatically by the package (v1.1+ and v2.x). No manual `Auth::provider()` registration needed.

**2.** Use Laravel's built-in auth as usual:

```
// Routes
Auth::routes();

// Check authentication
auth()->check();
auth()->guest();

// Get the authenticated WHMCS user
$user = auth()->user(); // Returns WhmcsUser instance
$user->email;
$user->firstname;
$user->lastname;
$user->userid;
```

On successful login, user data from WHMCS is cached in the session. Subsequent `auth()->user()` calls use the cached data for the duration of the session.

Single Sign-On (SSO)
--------------------

[](#single-sign-on-sso)

Authenticated users in your Laravel app are **not** automatically logged into WHMCS. Use SSO to redirect them.

### Version 2.x — CreateSsoToken (WHMCS 8.1+)

[](#version-2x--createssotoken-whmcs-81)

```
// Redirect to WHMCS client area (logged in)
return \Whmcs::redirectSso();

// Redirect to a specific WHMCS page
return \Whmcs::redirectSso('clientarea.php?action=invoices');

// Get just the SSO URL
$url = \Whmcs::getSsoUrl();
$url = \Whmcs::getSsoUrl('cart.php');
```

You can also call the underlying API directly:

```
$result = \Whmcs::createSsoToken(
    clientId: 123,
    destination: 'sso:custom_redirect',
    ssoRedirectPath: 'clientarea.php?action=products'
);

// $result['redirect_url'] contains the one-time login URL
```

See [CreateSsoToken API Reference](https://developers.whmcs.com/api-reference/createssotoken/).

### Version 1.x — AutoAuth (WHMCS 5.x - 8.0)

[](#version-1x--autoauth-whmcs-5x---80)

AutoAuth must be enabled in WHMCS. See [WHMCS AutoAuth](https://docs.whmcs.com/AutoAuth).

```
WHMCS_AUTOAUTH_KEY=your-autoauth-secret-key
```

```
// Redirect to WHMCS (logged in)
return \Whmcs::redirectAutoLogin();

// Redirect to a specific page
return \Whmcs::redirectAutoLogin('cart.php');

// Get just the URL
$url = \Whmcs::getAutoLoginUrl();
```

Migrating from v1.x to v2.x
---------------------------

[](#migrating-from-v1x-to-v2x)

### Requirements

[](#requirements)

- PHP 8.2+
- Laravel 10, 11, 12, or 13
- WHMCS 8.1+

### Breaking Changes

[](#breaking-changes)

**SSO:** Replace AutoAuth calls with CreateSsoToken:

```
// Before (v1.x)
return \Whmcs::redirectAutoLogin('cart.php');
$url = \Whmcs::getAutoLoginUrl();

// After (v2.x)
return \Whmcs::redirectSso('cart.php');
$url = \Whmcs::getSsoUrl();
```

The old methods still exist in v2.x but trigger deprecation notices and will be removed in v3.

**Config:** The default `session_key` changed from `user` to `whmcs_user`. If you rely on the default, either update your code or set `WHMCS_SESSION_USER_KEY=user` in your `.env`.

**SSL:** SSL verification is now enabled by default. If you were relying on the old behavior (verification disabled), set `WHMCS_VERIFY_SSL=false`.

**Auth provider registration:** If you previously registered the auth provider manually in `AuthServiceProvider`, you can remove that code — it's now handled automatically by the package.

### New Features in v2.x

[](#new-features-in-v2x)

- `sbGetClients()` supports `$orderby` and `$status` parameters (WHMCS 8.2+)
- Configurable request timeout via `WHMCS_TIMEOUT`
- Uses Laravel's HTTP client instead of raw Guzzle

Support
-------

[](#support)

[Please open an issue on GitHub](https://github.com/sburina/laravel-whmcs-up/issues)

License
-------

[](#license)

MIT License. See [LICENSE](https://github.com/sburina/laravel-whmcs-up/blob/master/LICENSE).

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance81

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 96.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~440 days

Recently: every ~373 days

Total

6

Last Release

101d ago

Major Versions

v1.1.0 → v2.0.02026-03-21

PHP version history (2 changes)1.x-devPHP &gt;=7.2

v2.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10303819?v=4)[sburina](/maintainers/sburina)[@sburina](https://github.com/sburina)

---

Top Contributors

[![sburina](https://avatars.githubusercontent.com/u/10303819?v=4)](https://github.com/sburina "sburina (27 commits)")[![angelformica](https://avatars.githubusercontent.com/u/13004762?v=4)](https://github.com/angelformica "angelformica (1 commits)")

---

Tags

laravellaravel-whmcswhmcswhmcs-api

### Embed Badge

![Health badge](/badges/sburina-laravel-whmcs-up/health.svg)

```
[![Health](https://phpackages.com/badges/sburina-laravel-whmcs-up/health.svg)](https://phpackages.com/packages/sburina-laravel-whmcs-up)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M932](/packages/statamic-cms)[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

3.0k37.6M127](/packages/darkaonline-l5-swagger)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k14.2M61](/packages/knuckleswtf-scribe)[kyon147/laravel-shopify

Shopify package for Laravel to aide in app development

485302.1k](/packages/kyon147-laravel-shopify)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[justbetter/laravel-magento-client

A client to interact with Magento

49108.7k14](/packages/justbetter-laravel-magento-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
