From 0b59ff91f34851ffbefcb4dd032efd2cf97a370e Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 27 Feb 2020 09:24:25 -0500 Subject: [PATCH] Remove airport length restrictions #590 --- app/Http/Requests/Acars/FileRequest.php | 4 ++-- app/Http/Requests/Acars/PrefileRequest.php | 10 ++++------ app/Http/Requests/Acars/UpdateRequest.php | 4 ++-- app/Models/Flight.php | 4 ++-- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app/Http/Requests/Acars/FileRequest.php b/app/Http/Requests/Acars/FileRequest.php index 63d9f12c9..0545c9340 100644 --- a/app/Http/Requests/Acars/FileRequest.php +++ b/app/Http/Requests/Acars/FileRequest.php @@ -25,8 +25,8 @@ public function rules(): array 'aircraft_id' => 'sometimes|exists:aircraft,id', 'flight_number' => 'sometimes', 'flight_type' => 'sometimes', - 'dpt_airport_id' => 'sometimes|size:4', - 'arr_airport_id' => 'sometimes|size:4', + 'dpt_airport_id' => 'sometimes', + 'arr_airport_id' => 'sometimes', 'route_code' => 'sometimes', 'route_leg' => 'sometimes', 'planned_distance' => 'sometimes|numeric', diff --git a/app/Http/Requests/Acars/PrefileRequest.php b/app/Http/Requests/Acars/PrefileRequest.php index e69e4eb1c..508732e16 100644 --- a/app/Http/Requests/Acars/PrefileRequest.php +++ b/app/Http/Requests/Acars/PrefileRequest.php @@ -8,15 +8,15 @@ class PrefileRequest extends FormRequest { public function rules(): array { - $rules = [ + return [ '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', + 'dpt_airport_id' => 'required', + 'arr_airport_id' => 'required', 'source_name' => 'required', - 'alt_airport_id' => 'sometimes|size:4', + 'alt_airport_id' => 'sometimes', 'status' => 'sometimes', 'level' => 'nullable|numeric', 'flight_type' => 'sometimes', @@ -41,7 +41,5 @@ public function rules(): array 'fares.*.id' => 'required', 'fares.*.count' => 'required|numeric', ]; - - return $rules; } } diff --git a/app/Http/Requests/Acars/UpdateRequest.php b/app/Http/Requests/Acars/UpdateRequest.php index 945684b25..10983fca4 100644 --- a/app/Http/Requests/Acars/UpdateRequest.php +++ b/app/Http/Requests/Acars/UpdateRequest.php @@ -21,8 +21,8 @@ public function rules(): array 'aircraft_id' => 'nullable|exists:aircraft,id', 'flight_id' => 'sometimes|nullable|exists:flights,id', 'flight_number' => 'sometimes|required', - 'dpt_airport_id' => 'sometimes|required|size:4', - 'arr_airport_id' => 'sometimes|required|size:4', + 'dpt_airport_id' => 'sometimes|required', + 'arr_airport_id' => 'sometimes|required', 'route_code' => 'nullable', 'route_leg' => 'nullable', 'distance' => 'sometimes|numeric', diff --git a/app/Models/Flight.php b/app/Models/Flight.php index 4fccc4ef5..58cc517c0 100644 --- a/app/Models/Flight.php +++ b/app/Models/Flight.php @@ -93,8 +93,8 @@ class Flight extends Model 'flight_number' => 'required', 'route_code' => 'nullable', 'route_leg' => 'nullable', - 'dpt_airport_id' => 'required|size:4|exists:airports,id', - 'arr_airport_id' => 'required|size:4|exists:airports,id', + 'dpt_airport_id' => 'required|exists:airports,id', + 'arr_airport_id' => 'required|exists:airports,id', 'level' => 'nullable', ];