PHPackages                             webreinvent/laravel-cpanel - 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. webreinvent/laravel-cpanel

ActiveLibrary[API Development](/categories/api)

webreinvent/laravel-cpanel
==========================

Laravel Package of CPanel API 2.0

1.3.8(3y ago)279.6k↓33.3%12[1 issues](https://github.com/webreinvent/laravel-cpanel/issues)MITPHPPHP ^7.4|^8.0

Since Nov 30Pushed 3y ago5 watchersCompare

[ Source](https://github.com/webreinvent/laravel-cpanel)[ Packagist](https://packagist.org/packages/webreinvent/laravel-cpanel)[ Docs](https://www.webreinvent.com)[ RSS](/packages/webreinvent-laravel-cpanel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (33)Used By (0)

Laravel CPanel
==============

[](#laravel-cpanel)

> Laravel Package for CPanel UAPI

Please consider starring the project to show your ❤️ and support.

> This laravel package allows you to manage you CPanel based hosting using CPanel UAPI.

Some practical usages are:

- Programmatically create database, sub domains, emails or accounts etc
- Programmatically create database users
- Programmatically set privileges on database of any user

Learn more about at [CPanel UAPI](https://documentation.cpanel.net/display/DD/Guide+to+UAPI)

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

[](#installation)

#### Step 1) Install the Package

[](#step-1-install-the-package)

Use following composer command to install the package

```
composer require webreinvent/laravel-cpanel
```

or Add `webreinvent/laravel-cpanel` as a requirement to `composer.json`:

```
{
    ...
    "require": {
        ...
        "webreinvent/laravel-cpanel": "dev-master"
    },
}

```

Update composer:

```
$ composer update

```

#### Step 2) Register the ServiceProvider

[](#step-2-register-the-serviceprovider)

Add following service provider in `config/app.php`

```
/*
 * Package Service Providers...
 */
 'providers' => [
        //...
        WebReinvent\CPanel\CPanelServiceProvider::class,
        //...
    ],
```

#### Step 3) Publish Configurations

[](#step-3-publish-configurations)

Run following command:

```
php artisan vendor:publish --provider="WebReinvent\CPanel\CPanelServiceProvider" --tag=config

```

#### Step 4) Set CPanel details in `.env`

[](#step-4-set-cpanel-details-in-env)

```
CPANEL_DOMAIN=
CPANEL_PORT=
CPANEL_API_TOKEN=
CPANEL_USERNAME=

```

or

```
$cpanel = new CPanel($cpanel_domain=null, $cpanel_api_token=null, $cpanel_username=null, $protocol='https', $port=2083);
```

To generate `CPANEL_API_TOKEN`, login to the `CPanel >> SECURITY >> Manage API Tokens >> Create`.

Usages &amp; available methods
------------------------------

[](#usages--available-methods)

Make sure you import:

```
use WebReinvent\CPanel\CPanel;
```

#### To Create Database

[](#to-create-database)

Database name should be prefixed with cpanel username `cpanelusername_databasename`

If your CPanel username is `foo` then your database name | should be `foo_website`.

```
$cpanel = new CPanel();
$response = $cpanel->createDatabase('cpanelusername_databasename');
```

Find More Details at [CPanel UAPI - Mysql::create\_database](https://documentation.cpanel.net/display/DD/UAPI+Functions+-+Mysql::create_database)

#### To Delete Database

[](#to-delete-database)

```
$cpanel = new CPanel();
$response = $cpanel->deleteDatabase('cpanelusername_databasename');
```

[CPanel UAPI - Mysql::delete\_database](https://documentation.cpanel.net/display/DD/UAPI+Functions+-+Mysql%3A%3Adelete_database)

#### To Get List of All Databases in the CPanel

[](#to-get-list-of-all-databases-in-the-cpanel)

```
$cpanel = new CPanel();
$response = $cpanel->listDatabases();
```

#### To Create Database User

[](#to-create-database-user)

```
$cpanel = new CPanel();
$response = $cpanel->createDatabaseUser($username, $password);
```

#### To Delete Database User

[](#to-delete-database-user)

```
$cpanel = new CPanel();
$response = $cpanel->deleteDatabaseUser($username);
```

#### To Give All Privileges to a Database User On a Database

[](#to-give-all-privileges-to-a-database-user-on-a-database)

```
$cpanel = new CPanel();
$response = $cpanel->setAllPrivilegesOnDatabase($database_user, $database_name);
```

Those were the available method but you can also call all the method available at [CPanel UAPI](https://documentation.cpanel.net/display/DD/Guide+to+UAPI) using following method:

```
$cpanel = new CPanel();
$response = $cpanel->callUAPI($Module, $function, $parameters_array);
```

Example if you want to add new `ftp` account, documetation is available at [CPanel UAPI - Ftp::add\_ftp](https://documentation.cpanel.net/display/DD/UAPI+Functions+-+Ftp%3A%3Aadd_ftp) then use the method as represented below:

```
$cpanel = new CPanel();
$Module = 'Ftp';
$function = 'add_ftp';
$parameters_array = [
'user'=>'ftp_username',
'pass'=>'ftp_password', //make sure you use strong password
'quota'=>'42',
];
$response = $cpanel->callUAPI($Module, $function, $parameters_array);
```

Support us
----------

[](#support-us)

[WebReinvent](https://www.webreinvent.com) is a web agency based in Delhi, India. You'll find an overview of all our open source projects [on github](https://github.com/webreinvent).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% 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 ~74 days

Recently: every ~65 days

Total

17

Last Release

1172d ago

PHP version history (3 changes)1.0.0PHP ^7.2

1.3.0PHP ^7.3|^8.0

1.3.4PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/45572020?v=4)[WebReinvent Technologies Pvt Ltd](/maintainers/webreinvent)[@webreinvent](https://github.com/webreinvent)

---

Top Contributors

[![themodernpk](https://avatars.githubusercontent.com/u/3604392?v=4)](https://github.com/themodernpk "themodernpk (73 commits)")[![wri-rahul-d](https://avatars.githubusercontent.com/u/105211548?v=4)](https://github.com/wri-rahul-d "wri-rahul-d (1 commits)")

---

Tags

cpanelcpanel-uapilaravellaravel-packagelaravelcpanelcpanel-apicpanel uapi

### Embed Badge

![Health badge](/badges/webreinvent-laravel-cpanel/health.svg)

```
[![Health](https://phpackages.com/badges/webreinvent-laravel-cpanel/health.svg)](https://phpackages.com/packages/webreinvent-laravel-cpanel)
```

###  Alternatives

[zanysoft/cpanel-api

Cpanel's API

2810.8k](/packages/zanysoft-cpanel-api)[gufy/cpanel-whm

Laravel cPanel/WHM API Package.

59123.8k2](/packages/gufy-cpanel-whm)[mhasnainjafri/cpanel

Laravel CPanel API Library for Managing cPanel Functionalities

2014.5k](/packages/mhasnainjafri-cpanel)[rakibdevs/openweather-laravel-api

Laravel package to connect https://openweathermap.org/ to get customized weather data for any location on the globe immediately

7648.2k](/packages/rakibdevs-openweather-laravel-api)

PHPackages © 2026

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