-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0445d99
Showing
11 changed files
with
868 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# PHP Laravel cPanel | ||
A php laravel package to manage cPanel email accounts | ||
|
||
## Installation | ||
``` | ||
composer require naif/php-cpanel-email | ||
``` | ||
|
||
Add service provider and alias to config/app.php | ||
``` | ||
Under Providers: | ||
\Naif\cPanelMail\cPanelServiceProvider::class, | ||
Under aliases: | ||
'cPanel' => \Naif\cPanelMail\Facades\cPanelMail::class, | ||
``` | ||
|
||
Add these to your .env | ||
``` | ||
CPANEL_DOMAIN=your_domain.com | ||
CPANEL_HOST=https://your_domain.com | ||
CPANEL_PORT=2083 // cPanel port Default is: 2083 | ||
CPANEL_VERSION=2 // cPanel api current version | ||
CPANEL_USERNAME=your_cpanel_username | ||
CPANEL_PASSWORD=your_cpanel_password | ||
``` | ||
## Usage | ||
|
||
Create a class object | ||
```php | ||
$cpanel = new cPanel() | ||
``` | ||
|
||
Get a list of all email addresses | ||
```php | ||
$cpanel->getEmailAddresses() | ||
|
||
Response: | ||
array:5 [ | ||
0 => Email {#227 ▼ | ||
+user: "abc" | ||
+domain: "domain.com" | ||
+email: "abc@domain.com" | ||
+_diskused: 0 | ||
+_diskquota: 0 | ||
+humandiskused: "None" | ||
+humandiskquota: "None" | ||
+suspended_incoming: 0 | ||
+suspended_login: 0 | ||
+mtime: 1539715896 | ||
} | ||
] | ||
``` | ||
|
||
Create a new email account | ||
```php | ||
$cpanel->create('username','password') | ||
|
||
Response: | ||
[ | ||
"status" => "success" | ||
"message" => "Email address has been added successfully" | ||
] | ||
``` | ||
|
||
Delete an new email account | ||
```php | ||
$cpanel->delete('email_address') | ||
|
||
Response: | ||
[ | ||
"status" => "success" | ||
"message" => "Email address has been deleted successfully" | ||
] | ||
``` | ||
|
||
## Support: | ||
naif@naif.io | ||
|
||
https://www.linkedin.com/in/naif | ||
|
||
## License | ||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "naif/php-cpanel-email", | ||
"description": "Manage cPanel Email Addresses", | ||
"keywords": [ | ||
"cPanel", | ||
"email", | ||
"email_address", | ||
"php" | ||
], | ||
"type": "library", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Naif Alshaye", | ||
"email": "naif@naif.io" | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
"require": { | ||
"guzzlehttp/guzzle": "^6.3@dev" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"App\\": "app/", | ||
"Naif\\cPanelMail\\": "src/" | ||
} | ||
} | ||
} |
Oops, something went wrong.