From df9411e1bf9ca9904b17ff07b72215d7d5543b57 Mon Sep 17 00:00:00 2001 From: cp6 Date: Thu, 22 Sep 2022 13:20:44 +1000 Subject: [PATCH] Updated compare view for nullable values Updated compare view for nullable values --- resources/views/yabs/compare.blade.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/resources/views/yabs/compare.blade.php b/resources/views/yabs/compare.blade.php index 29245c6..25dd2d9 100644 --- a/resources/views/yabs/compare.blade.php +++ b/resources/views/yabs/compare.blade.php @@ -88,13 +88,21 @@ GB5 single {{$yabs1_data[0]->gb5_single}} - {!! \App\Models\Server::tableRowCompare($yabs1_data[0]->gb5_single, $yabs2_data[0]->gb5_single, '') !!} + @if(!is_null($yabs1_data[0]->gb5_single) && !is_null($yabs2_data[0]->gb5_single)) + {!! \App\Models\Server::tableRowCompare($yabs1_data[0]->gb5_single, $yabs2_data[0]->gb5_single, '') !!} + @else + - + @endif {{$yabs2_data[0]->gb5_single}} GB5 multi {{$yabs1_data[0]->gb5_multi}} - {!! \App\Models\Server::tableRowCompare($yabs1_data[0]->gb5_multi, $yabs2_data[0]->gb5_multi, '') !!} + @if(!is_null($yabs1_data[0]->gb5_multi) && !is_null($yabs2_data[0]->gb5_multi)) + {!! \App\Models\Server::tableRowCompare($yabs1_data[0]->gb5_multi, $yabs2_data[0]->gb5_multi, '') !!} + @else + - + @endif {{$yabs2_data[0]->gb5_multi}} @@ -181,7 +189,7 @@ @endif - @if($yabs1_data[0]->network_speed[3]->location === $yabs2_data[0]->network_speed[3]->location) + @if(isset($yabs1_data[0]->network_speed[3]) && $yabs1_data[0]->network_speed[3]->location === $yabs2_data[0]->network_speed[3]->location) {{$yabs1_data[0]->network_speed[3]->location}} send {{$yabs1_data[0]->network_speed[3]->send_as_mbps}} @endif - @if($yabs1_data[0]->network_speed[4]->location === $yabs2_data[0]->network_speed[4]->location) + @if(isset($yabs1_data[0]->network_speed[4]) && $yabs1_data[0]->network_speed[4]->location === $yabs2_data[0]->network_speed[4]->location) {{$yabs1_data[0]->network_speed[4]->location}} send {{$yabs1_data[0]->network_speed[4]->send_as_mbps}} @endif - @if($yabs1_data[0]->network_speed[4]->location === $yabs2_data[0]->network_speed[5]->location) + @if(isset($yabs1_data[0]->network_speed[4]) && $yabs1_data[0]->network_speed[4]->location === $yabs2_data[0]->network_speed[5]->location) {{$yabs1_data[0]->network_speed[4]->location}} send {{$yabs1_data[0]->network_speed[4]->send_as_mbps}}