diff --git a/app/Models/System.php b/app/Models/System.php index e5dc662..584f0a1 100644 --- a/app/Models/System.php +++ b/app/Models/System.php @@ -52,7 +52,7 @@ class System extends Model */ public function zcs() { - return $this->belongsToMany(Zone::class); + return $this->hasMany(Zone::class); } /** diff --git a/resources/views/system/addedit.blade.php b/resources/views/system/addedit.blade.php index d518cfd..204c571 100644 --- a/resources/views/system/addedit.blade.php +++ b/resources/views/system/addedit.blade.php @@ -14,7 +14,7 @@ use App\Http\Controllers\DomainController as DC; @if($o->setup)* This Host@endif @endif - @if($o->zcs) + @if($o->zcs->count())

This system is the ZC for the following zones: {!! $o->zcs->map(function($item) { return sprintf('%d@%s',$item->zone_id,$item->domain->name); })->join(', ') !!}

@endif