osb/app/Models/Service/Domain.php
2020-02-10 22:07:46 +11:00

24 lines
448 B
PHP

<?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';
protected $with = ['tld'];
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);
}
}