PHPackages                             miladyousefi/whmcs - 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. [Framework](/categories/framework)
4. /
5. miladyousefi/whmcs

ActiveProject[Framework](/categories/framework)

miladyousefi/whmcs
==================

Framework for creating WHMCS addon modules.

v1.0.0(1y ago)0281MITPHPPHP &gt;=8.0

Since Nov 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/miladyousefi/whmcs)[ Packagist](https://packagist.org/packages/miladyousefi/whmcs)[ RSS](/packages/miladyousefi-whmcs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (1)

WHMCS Addon Module Framework (WAM)
==================================

[](#whmcs-addon-module-framework-wam)

WAM is a powerful framework designed to simplify the creation and management of WHMCS addon modules. It provides a structured approach with modern PHP practices and helpful CLI commands.

Installation
------------

[](#installation)

To create a new WHMCS addon module, use Composer:

```
composer create-project asamserver/wam your-addon-name dev-main
```

This will create a new directory with your addon name and install all necessary dependencies.

Directory Structure
-------------------

[](#directory-structure)

After installation, your project will have the following structure:

```
your-addon-name/
├── app/
│   ├── Controllers/
│   ├── Dispatcher/
│   ├── Helper/
│   └── Models/
├── commands/
├── database/
├── resource/
│   ├── css/
│   ├── js/
│   └── views/
└── routes/

```

Available Commands
------------------

[](#available-commands)

WAM comes with several CLI commands to help you build your addon module:

### 1. Create Addon Module

[](#1-create-addon-module)

```
php whmcs make:addon YourAddonName
```

This command will:

- Create the main addon file
- Set up the basic directory structure
- Generate necessary dispatcher files
- Create a base controller
- Set up routing configuration

**Output:**

```
Created app directory: /path/to/your/addon/app
Created addon file: /path/to/your/addon/YourAddonName.php
Created Application file: /path/to/your/addon/app/Application.php
Created Helper directory: /path/to/your/addon/app/Helper
Created helper file: /path/to/your/addon/app/Helper/Helper.php
Created adminDispatcher directory: /path/to/your/addon/app/Dispatcher
Created AdminDispatcher file: /path/to/your/addon/app/Dispatcher/AdminDispatcher.php
Created AdminDispatcher file: /path/to/your/addon/app/Dispatcher/ClientDispatcher.php
Created Router file: /path/to/your/addon/app/Router.php
Created BaseController directory: /path/to/your/addon/app/Controllers
Created BaseController file: /path/to/your/addon/app/Controllers/BaseController.php

```

### 2. Create Controller

[](#2-create-controller)

```
php whmcs make:controller Admin/DashboardController
```

Creates a new controller with basic structure and routing.

**Output:**

```
Created controller: /path/to/your/addon/app/Controllers/Admin/DashboardController.php

```

### 3. Create Model

[](#3-create-model)

```
php whmcs make:model User
```

Generates a new Eloquent model class.

**Output:**

```
Created model: /path/to/your/addon/app/Models/User.php

```

### 4. Create Migration

[](#4-create-migration)

```
php whmcs make:migration users
```

Creates a new database migration file.

**Output:**

```
Created database directory: /path/to/your/addon/database
Created migration file: /path/to/your/addon/database/YYYY_MM_DD_HHMMSS_create_users_table.php

```

### 5. Create Environment File

[](#5-create-environment-file)

```
php whmcs make:env
```

Creates a .env file from .env.example if it doesn't exist.

**Output:**

```
.env file successfully created from .env.example

```

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

[](#configuration)

### Environment Variables

[](#environment-variables)

The following environment variables can be configured in your `.env` file:

```
MODULE=YourAddonName
AUTHOR=Your Name
VERSION=1.0.0
APP_ENABLE=true
DELETE_TABLES=false
```

### Routes

[](#routes)

Define your routes in `routes/web.php`:

```
return [
    // Admin routes
    'admin/dashboard' => [
        'controller' => DashboardController::class,
        'action' => 'index',
    ],

    // Client routes
    'client/dashboard' => [
        'controller' => ClientDashboardController::class,
        'action' => 'index',
    ],
];
```

Views and Assets
----------------

[](#views-and-assets)

### Views

[](#views)

Place your view files in `resource/views/`. The BaseController provides a `renderView` method:

```
public function index()
{
    return $this->renderView('dashboard', [
        'title' => 'Dashboard',
        'data' => $someData
    ]);
}
```

### CSS and JavaScript

[](#css-and-javascript)

- CSS files go in `resource/css/`
- JavaScript files go in `resource/js/`
- Access them using `renderCss()` and `renderJs()` methods in BaseController

Helper Functions
----------------

[](#helper-functions)

The framework provides several helper functions in `app/Helper/Helper.php`:

- `generateRandomNumber()`: Generates a random number
- `getClientId()`: Gets the current client ID
- `getControllerClass()`: Gets the fully qualified controller class name

Best Practices
--------------

[](#best-practices)

1. Always use the provided CLI commands to generate new files
2. Follow PSR-4 autoloading standards
3. Use migrations for database changes
4. Keep controllers thin and move business logic to models
5. Use environment variables for configuration
6. Follow WHMCS security best practices

Requirements
------------

[](#requirements)

- PHP &gt;= 8.0
- WHMCS installation
- Composer

Dependencies
------------

[](#dependencies)

The framework includes:

- illuminate/database
- symfony/console
- vlucas/phpdotenv

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance40

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

535d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79af00f03b890d2d1904a4f16361b6123d1942ced682fbc96ff9fab881b1bad9?d=identicon)[miladyousefi](/maintainers/miladyousefi)

---

Top Contributors

[![miladyousefi](https://avatars.githubusercontent.com/u/58238218?v=4)](https://github.com/miladyousefi "miladyousefi (38 commits)")

---

Tags

Whmcs

### Embed Badge

![Health badge](/badges/miladyousefi-whmcs/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M16.9k](/packages/laravel-framework)[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M529](/packages/laravel-passport)[laravel/sail

Docker files for running a basic Laravel application.

1.9k186.9M1.0k](/packages/laravel-sail)[laravel/jetstream

Tailwind scaffolding for the Laravel framework.

4.1k19.8M136](/packages/laravel-jetstream)[composer/installers

A multi-framework Composer library installer

1.4k136.0M6.0k](/packages/composer-installers)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)

PHPackages © 2026

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