Files
portal-api/app/Http/Resources/Api/Admin/HostingAccountResource.php
baodev0 d6d63e5152 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.
2026-08-06 17:24:01 +07:00

34 lines
1.5 KiB
PHP

<?php
namespace App\Http\Resources\Api\Admin;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class HostingAccountResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'customer_id' => $this->customer_id,
'customer_name' => $this->whenLoaded('customer', fn () => $this->customer?->fullname),
'service_id' => $this->service_id,
'dns_manager_server_id' => $this->dns_manager_server_id,
'server_name' => $this->whenLoaded('server', fn () => $this->server?->name),
'dns_manager_domain_id' => $this->dns_manager_domain_id,
'domain_name' => $this->whenLoaded('domain', fn () => $this->domain?->domain_name),
'plesk_client_id' => $this->plesk_client_id,
'plesk_subscription_id' => $this->plesk_subscription_id,
'plesk_guid' => $this->plesk_guid,
'hosting_plan' => $this->hosting_plan,
'ftp_username' => $this->ftp_username,
'system_username' => $this->system_username,
'document_root' => $this->document_root,
'status' => $this->status,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}