<?php

namespace App\Models\Service;

use App\Traits\NextKey;

class Domain extends \App\Models\Base\ServiceType
{
	use NextKey;

	const RECORD_ID = 'service__domain';

	protected $table = 'ab_service__domain';

	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);
	}
}