feat: Implement Plesk domain and hosting services
- Added PleskDomainService for managing domain operations (create, update, remove, get info). - Introduced PleskHostingService for provisioning hosting accounts and notifying customers. - Created PleskService for handling API requests to Plesk. - Added migration to include 'type' column in dns_manager_servers table. - Created migration for module_hosting_accounts table to track hosting subscriptions. - Created migration for module_hosting_plesk_clients table to manage Plesk client credentials. - Added email templates for notifying customers and admins about hosting account creation.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\Server\ServerType;
|
||||
use App\Traits\LogsActivity;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -19,6 +20,7 @@ class DnsServer extends Model
|
||||
'username',
|
||||
'api_key',
|
||||
'status',
|
||||
'type',
|
||||
];
|
||||
|
||||
public function getStatus(): string
|
||||
@@ -30,6 +32,13 @@ class DnsServer extends Model
|
||||
};
|
||||
}
|
||||
|
||||
public function servesHosting(): bool
|
||||
{
|
||||
$type = $this->attributes['type'] ?? ServerType::DOMAIN->value;
|
||||
|
||||
return in_array($type, [ServerType::HOSTING->value, ServerType::BOTH->value], true);
|
||||
}
|
||||
|
||||
protected function scopeIsActive($query)
|
||||
{
|
||||
return $query->where('status', 'activated');
|
||||
|
||||
Reference in New Issue
Block a user