From ae96ff9a2495a7be67ae9442fa3eab339464fc48 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 15 Aug 2021 16:01:51 +1000 Subject: [PATCH] Fix System ZC identification --- app/Models/System.php | 2 +- resources/views/system/addedit.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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