osb/app/Models/Service/Domain.php

24 lines
448 B
PHP
Raw Normal View History

<?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';
2020-02-10 11:07:46 +00:00
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);
}
}