Page MenuHomePhorge

DomainObserver.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

DomainObserver.php

<?php
namespace App\Observers\PowerDNS;
use App\PowerDNS\Domain;
class DomainObserver
{
public function created(Domain $domain)
{
\App\PowerDNS\Record::create(
[
'domain_id' => $domain->id,
'name' => $domain->name,
'type' => "SOA",
'content' => sprintf(
"ns.%s. hostmaster.%s. %s 1200 600 1814400 60",
$domain->name,
$domain->name,
\Carbon\Carbon::now()->format('Ymd') . '01'
)
]
);
\App\PowerDNS\Record::withoutEvents(
function () use ($domain) {
\App\PowerDNS\Record::create(
[
'domain_id' => $domain->id,
'name' => $domain->name,
'type' => "NS",
'content' => \config('app.woat_ns1')
]
);
}
);
\App\PowerDNS\Record::withoutEvents(
function () use ($domain) {
\App\PowerDNS\Record::create(
[
'domain_id' => $domain->id,
'name' => $domain->name,
'type' => "NS",
'content' => \config('app.woat_ns2')
]
);
}
);
\App\PowerDNS\DomainSetting::create(
[
'domain_id' => $domain->id,
'kind' => 'ENABLE-LUA-RECORDS',
'content' => "0"
]
);
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Nov 21, 7:16 AM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
387431
Default Alt Text
DomainObserver.php (1 KB)

Event Timeline