From 9956929df7a8815dd886a4c6cb8eca98814c90a4 Mon Sep 17 00:00:00 2001 From: "B.Fatih KOZ" Date: Tue, 2 Nov 2021 16:00:29 +0300 Subject: [PATCH] Add callsign to flight search (#1341) Make callsign searchable Co-authored-by: Nabeel S --- app/Repositories/FlightRepository.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Repositories/FlightRepository.php b/app/Repositories/FlightRepository.php index 0ab45f75..4faa4ad5 100644 --- a/app/Repositories/FlightRepository.php +++ b/app/Repositories/FlightRepository.php @@ -18,6 +18,7 @@ class FlightRepository extends Repository implements CacheableInterface protected $fieldSearchable = [ 'arr_airport_id', + 'callsign', 'distance', 'dpt_airport_id', 'flight_type', @@ -94,6 +95,10 @@ class FlightRepository extends Repository implements CacheableInterface $where['flight_number'] = $request->input('flight_number'); } + if ($request->filled('callsign')) { + $where['callsign'] = $request->input('callsign'); + } + if ($request->filled('flight_type') && $request->input('flight_type') !== '0') { $where['flight_type'] = $request->input('flight_type'); }