Add system_id when listing AKAs, so that we can reference the system relation.

This commit is contained in:
Deon George 2024-06-21 14:44:28 +10:00
parent 7bd192980f
commit 8b4e2cb9f0

View File

@ -395,7 +395,8 @@ class Address extends Model
*/
public function scopeFTN($query)
{
return $query->select(['id','addresses.zone_id','host_id','node_id','point_id'])
return $query
->select(['id','addresses.zone_id','host_id','node_id','point_id','system_id'])
->with([
'zone:zones.id,domain_id,zone_id',
'zone.domain:domains.id,name',
@ -602,9 +603,13 @@ class Address extends Model
public function nodes_hub(): HasMany
{
return $this->hasMany(Address::class,'hub_id','id')
->FTN()
->select(['id','addresses.zone_id','host_id','node_id','point_id','system_id'])
->active()
->FTNorder();
->FTNorder()
->with([
'zone:zones.id,domain_id,zone_id',
'zone.domain:domains.id,name',
]);
}
/**