Work on VOIP and Domain products
This commit is contained in:
@@ -2,23 +2,46 @@
|
||||
|
||||
namespace App\Models\Service;
|
||||
|
||||
use App\Models\Base\ServiceType;
|
||||
use App\Models\DomainRegistrar;
|
||||
use App\Models\DomainTld;
|
||||
use App\Interfaces\ServiceItem;
|
||||
use App\Traits\NextKey;
|
||||
|
||||
class Domain extends \App\Models\Base\ServiceType
|
||||
class Domain extends ServiceType implements ServiceItem
|
||||
{
|
||||
use NextKey;
|
||||
const RECORD_ID = 'service__domain';
|
||||
|
||||
protected $dates = [
|
||||
'domain_expire',
|
||||
];
|
||||
protected $table = 'ab_service__domain';
|
||||
protected $with = ['tld'];
|
||||
|
||||
public function tld()
|
||||
public function registrar()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\DomainTld::class,'domain_tld_id');
|
||||
return $this->belongsTo(DomainRegistrar::class,'domain_registrar_id');
|
||||
}
|
||||
|
||||
public function getNameAttribute()
|
||||
public function tld()
|
||||
{
|
||||
return sprintf('%s.%s',$this->domain_name,$this->tld->name);
|
||||
return $this->belongsTo(DomainTld::class,'domain_tld_id');
|
||||
}
|
||||
|
||||
public function getServiceDescriptionAttribute(): string
|
||||
{
|
||||
// N/A
|
||||
return '';
|
||||
}
|
||||
|
||||
public function getServiceNameAttribute(): string
|
||||
{
|
||||
return sprintf('%s.%s',strtoupper($this->domain_name),strtoupper($this->tld->name));
|
||||
}
|
||||
|
||||
public function inContract(): bool
|
||||
{
|
||||
return $this->domain_expire->isFuture();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user