25 lines
424 B
PHP
25 lines
424 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Models;
|
||
|
|
||
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
||
|
class ServiceDomain extends Model
|
||
|
{
|
||
|
protected $table = 'ab_service__domain';
|
||
|
|
||
|
public function service()
|
||
|
{
|
||
|
return $this->belongsTo(Service::class);
|
||
|
}
|
||
|
|
||
|
public function tld()
|
||
|
{
|
||
|
return $this->belongsTo(DomainTld::class,'domain_tld_id');
|
||
|
}
|
||
|
|
||
|
public function getNameAttribute()
|
||
|
{
|
||
|
return sprintf('%s.%s',$this->domain_name,$this->tld->name);
|
||
|
}
|
||
|
}
|