feat: Add DNS management resources and importer
- Implemented DomainCollection, DomainDetailResource, DomainNSCollection, DomainNSResource, and DomainResource for handling DNS domain and record data. - Created VpsServiceCollection and VpsServiceResource for VPS service management. - Added DnsManagerNS and DnsManagerUser models to represent DNS records and user associations. - Developed AdminZoneDnsSqlImporter for importing DNS data from SQL dumps, including customer and DNS domain records. - Added migration scripts to update the customers table with new fields and sync foreign key references for DNS tables. - Created a migration preview document outlining the mapping and schema changes for the admin zone DNS import.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources\Api\Service;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class DomainNSResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'dns_manager_domain_id' => $this->dns_manager_domain_id,
|
||||
'name' => $this->name,
|
||||
'type' => $this->type,
|
||||
'type_valid' => $this->type_valid,
|
||||
'priority' => $this->priority,
|
||||
'weight' => $this->weight,
|
||||
'port' => $this->port,
|
||||
'service_name' => $this->service_name,
|
||||
'protocol' => $this->protocol,
|
||||
'value' => $this->value,
|
||||
'ttl' => isset($this->ttl) ? (int) $this->ttl : null,
|
||||
'plesk_id' => $this->plesk_id,
|
||||
'created_at' => optional($this->created_at)->toISOString(),
|
||||
'updated_at' => optional($this->updated_at)->toISOString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user