Use optional() around the airport fields (#537)

* Use optional() around the airport fields

* Add null-coalesce around full_name
This commit is contained in:
Nabeel S
2020-02-03 12:23:58 -05:00
committed by GitHub
parent 5e4a003a92
commit 94cfbd4748
6 changed files with 39 additions and 39 deletions
@@ -58,9 +58,9 @@
{{ $flight->ident }}
</a>
</td>
<td class="text-left">{{ $flight->dpt_airport->name }}
<td class="text-left">{{ optional($flight->dpt_airport)->name }}
(<a href="{{route('frontend.airports.show',
['id'=>$flight->dpt_airport->icao])}}">{{$flight->dpt_airport->icao}}</a>)
['id' => $flight->dpt_airport_id])}}">{{$flight->dpt_airport_id}}</a>)
</td>
<td>{{ $flight->dpt_time }}</td>
<td>{{ $flight->arr_time }}</td>