diff --git a/resources/views/admin/pireps/fields.blade.php b/resources/views/admin/pireps/fields.blade.php index 73b2c60d..4998ec33 100644 --- a/resources/views/admin/pireps/fields.blade.php +++ b/resources/views/admin/pireps/fields.blade.php @@ -1,4 +1,4 @@ -@if($pirep->read_only) +@if(!empty($pirep) && $pirep->read_only)
{{ $pirep->airline->name }}
{{ Form::hidden('airline_id') }} @else @@ -35,14 +35,15 @@ flight reports that have been filed. You've been warned! {{ Form::select('airline_id', $airline_list, null, [ 'class' => 'custom-select select2', 'style' => 'width: 100%', - 'readonly' => $pirep->read_only]) }} + 'readonly' => (!empty($pirep) && $pirep->read_only), + ]) }}{{ $errors->first('airline_id') }}
@endif{{ $pirep->ident }} {{ Form::hidden('flight_number') }} {{ Form::hidden('flight_code') }} @@ -51,19 +52,22 @@ flight reports that have been filed. You've been warned! @else
{{ $errors->first('flight_number') }}
{{ $errors->first('route_code') }}
@@ -72,7 +76,7 @@ flight reports that have been filed. You've been warned!{{ \App\Models\Enums\FlightType::label($pirep->flight_type) }}
{{ Form::hidden('flight_type') }} @else @@ -81,7 +85,7 @@ flight reports that have been filed. You've been warned! \App\Models\Enums\FlightType::select(), null, [ 'class' => 'custom-select select2', 'style' => 'width: 100%', - 'readonly' => $pirep->read_only + 'readonly' => (!empty($pirep) && $pirep->read_only), ]) }}{{ $pirep->hours }} hours, {{ $pirep->minutes }} minutes {{ Form::hidden('hours') }} @@ -105,14 +109,14 @@ flight reports that have been filed. You've been warned! 'class' => 'form-control', 'placeholder' => 'hours', 'min' => '0', - 'readonly' => $pirep->read_only - ]) }} + 'readonly' => (!empty($pirep) && $pirep->read_only), + ]) }} {{ Form::number('minutes', null, [ 'class' => 'form-control', 'placeholder' => 'minutes', 'min' => 0, - 'readonly' => $pirep->read_only + 'readonly' => (!empty($pirep) && $pirep->read_only), ]) }}
{{ $errors->first('hours') }}
@@ -160,7 +164,7 @@ flight reports that have been filed. You've been warned!{{ $pirep->aircraft->name }}
{{ Form::hidden('aircraft_id') }} @else @@ -218,7 +222,7 @@ flight reports that have been filed. You've been warned! {{ Form::select('aircraft_id', $aircraft_list, null, [ 'id' => 'aircraft_select', 'class' => 'custom-select select2', - 'readonly' => $pirep->read_only + 'readonly' => (!empty($pirep) && $pirep->read_only), ]) }}{{ $errors->first('aircraft_id') }}
@@ -228,6 +232,22 @@ flight reports that have been filed. You've been warned!{{ $errors->first('route') }}
+{{ $errors->first('route') }}
-{{ $errors->first('notes') }}