swalker2/cpanel
Larablocks Analysis
swalker2/cpanel works with Laravel 5 (latest release v1.1, Feb 3, 2017), which reached end of life: no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 5, past end of life
- No release in the last 12 months (last: Feb 3, 2017)
- 0 downloads a month (needs 10,000)
- 3 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Feb 3, 2017.
- No releases in the last 12 months.
- First released: Feb 3, 2017.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 3, 2026.
| Install | |
|---|---|
composer require swalker2/cpanel |
|
| Latest Version: | v1.1 |
| PHP: | >=5.6.4 |
| Laravel: | 5 |
| License: | MIT |
| Last Updated: | May 13, 2017 |
| Links: | GitHub · Packagist |
#swalker2 - Cpanel
The simplest PHP implementation of the cpanel version 2 api for Laravel
At the moment suporting only the Zone Edit and Email modules
You can write your own modules if you dig into the Guide to cPanel API 2
Install
Require this package with composer using the following command:
composer require swalker2/cpanel
After updating composer, add the service provider to the providers array in config/app.php
Swalker2\Cpanel\CpanelServiceProvider::class,
Also, publish the configuration file using the following command:
php artisan vendor:publish --tag=swalker2.cpanel
Finally, add the .env variables:
CPANEL_HOST=https://domain.com
CPANEL_PORT=2083
CPANEL_USERNAME=yourname
CPANEL_PASSWORD=yourpass
But how do I use it?
After completing the instalation steps, you simply make a cpanel instance, like so:
$cpanel = app()->make(Cpanel::class);
And then you can call the module implementations
dd(
$cpanel->zoneEdit('mydomain.com')->fetch()
);
Note that the Modules that you create can be instantiated individually:
$mymodule = new MyCpanelModule();
dd(
$mymodule->doSomething()
);
Writing a module
To write a module you need to extend the class Swalker2\CpanelFunction
like so:
namespace App;
use Swalker2\Cpanel\CpanelBaseModule;
class CpanelModule extends CpanelBaseModule
{
function __construct()
{
parent::__construct();
$this->cpanel->mergeFields([
'cpanel_jsonapi_module' => 'ModuleName', //reference this from the Guide to cPanel API 2
]);
}
public function someAction()
{
$this->cpanel->mergeFields([
'cpanel_jsonapi_func' => 'some_action',
]);
$response = $this->getApiData();
//do something with the response
}
}
Contributing
Feel free to send pull requests, not just bug reports.
"Bug reports" may also be sent in the form of a pull request containing a failing test.
However, if you file a bug report, your issue should contain a title and a clear description of the issue. You should also include as much relevant information as possible and a code sample that demonstrates the issue. The goal of a bug report is to make it easy for yourself - and others - to replicate the bug and develop a fix.
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.1 | >=5.6.4 | ^5.4 | MIT |