2019-06-07 06:54:27 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models\Service;
|
|
|
|
|
2019-06-13 04:32:34 +00:00
|
|
|
use App\Traits\NextKey;
|
|
|
|
|
2019-06-07 06:54:27 +00:00
|
|
|
class Domain extends \App\Models\Base\ServiceType
|
|
|
|
{
|
2019-06-13 04:32:34 +00:00
|
|
|
use NextKey;
|
|
|
|
const RECORD_ID = 'service__domain';
|
|
|
|
|
2019-06-07 06:54:27 +00:00
|
|
|
protected $table = 'ab_service__domain';
|
2020-02-10 11:07:46 +00:00
|
|
|
protected $with = ['tld'];
|
2019-06-07 06:54:27 +00:00
|
|
|
|
|
|
|
public function tld()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(\App\Models\DomainTld::class,'domain_tld_id');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getNameAttribute()
|
|
|
|
{
|
|
|
|
return sprintf('%s.%s',$this->domain_name,$this->tld->name);
|
|
|
|
}
|
|
|
|
}
|