Added in email hosting, and other misc cosmetic fixes
This commit is contained in:
@@ -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 */
|
||||
}
|
Reference in New Issue
Block a user