Added in email hosting, and other misc cosmetic fixes

This commit is contained in:
Deon George
2022-04-02 18:06:34 +11:00
parent 7775105da6
commit a4ed29b560
35 changed files with 1181 additions and 104 deletions

View File

@@ -27,46 +27,11 @@ class Domain extends ServiceType implements ServiceItem
protected $dates = [
'domain_expire',
];
public $dateFormat = 'U';
protected $table = 'service_domains';
protected $with = ['tld'];
/* RELATIONS */
public function account()
{
return $this->hasOneThrough(Account::class,Service::class);
}
public function registrar()
{
return $this->belongsTo(DomainRegistrar::class,'domain_registrar_id');
}
public function tld()
{
return $this->belongsTo(DomainTld::class,'domain_tld_id');
}
/* SCOPES */
/**
* Search for a record
*
* @param $query
* @param string $term
* @return mixed
*/
public function scopeSearch($query,string $term)
{
// If we have a period in the name, we'll ignore everything after it.
$term = strstr($term,'.',TRUE) ?: $term;
// Build our where clause
return parent::scopeSearch($query,$term)
->orwhere('domain_name','like','%'.$term.'%');
}
/* ATTRIBUTES */
/* INTERFACES */
public function getServiceDescriptionAttribute(): string
{
@@ -93,4 +58,41 @@ class Domain extends ServiceType implements ServiceItem
{
return $this->domain_expire->isFuture();
}
/* RELATIONS */
public function account()
{
return $this->hasOneThrough(Account::class,Service::class);
}
public function registrar()
{
return $this->belongsTo(DomainRegistrar::class,'domain_registrar_id');
}
public function tld()
{
return $this->belongsTo(DomainTld::class,'domain_tld_id');
}
/* SCOPES */
/**
* Search for a record
*
* @param $query
* @param string $term
* @return mixed
*/
public function scopeSearch($query,string $term)
{
// If we have a period in the name, we'll ignore everything after it.
$term = strstr($term,'.',TRUE) ?: $term;
// Build our where clause
return parent::scopeSearch($query,$term)
->orwhere('domain_name','like','%'.$term.'%');
}
/* ATTRIBUTES */
}