Fix for flight_number check forcing to exist

This commit is contained in:
Nabeel Shahzad 2019-12-03 15:45:18 -05:00
parent b06287da23
commit 64a04f70a3
2 changed files with 3 additions and 2 deletions

View File

@ -11,10 +11,10 @@ class PrefileRequest extends FormRequest
$rules = [
'airline_id' => 'required|exists:airlines,id',
'aircraft_id' => 'required|exists:aircraft,id',
'flight_id' => 'sometimes|exists:flights,id',
'flight_number' => 'required',
'dpt_airport_id' => 'required|size:4',
'arr_airport_id' => 'required|size:4',
'flight_id' => 'sometimes|exists:flights,id',
'source_name' => 'required',
'alt_airport_id' => 'sometimes|size:4',
'status' => 'sometimes',

View File

@ -19,7 +19,8 @@ class UpdateRequest extends FormRequest
$rules = [
'airline_id' => 'nullable|exists:airlines,id',
'aircraft_id' => 'nullable|exists:aircraft,id',
'flight_number' => 'sometimes|required|exists:flights,id',
'flight_id' => 'sometimes|exists:flights,id',
'flight_number' => 'sometimes|required',
'dpt_airport_id' => 'sometimes|required|size:4',
'arr_airport_id' => 'sometimes|required|size:4',
'route_code' => 'nullable',