28 lines
775 B
PHP
28 lines
775 B
PHP
<?php
|
|
|
|
namespace App\Integrations\Domain\Writers;
|
|
|
|
use App\Integrations\Domain\DTOs\DnsServerData;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class DnsServerWriter
|
|
{
|
|
public function write(DnsServerData $data): void
|
|
{
|
|
DB::table('dns_manager_servers')->updateOrInsert(
|
|
['legacy_id' => $data->legacyId],
|
|
[
|
|
'name' => $data->name,
|
|
'ip_address' => $data->ipAddress,
|
|
'username' => $data->username,
|
|
'password' => $data->password,
|
|
'api_key' => $data->apiKey,
|
|
'status' => $data->status,
|
|
'type' => 'domain',
|
|
'created_at' => $data->createdAt,
|
|
'updated_at' => $data->updatedAt,
|
|
]
|
|
);
|
|
}
|
|
}
|