Add callsign to flight search (#1341)

Make callsign searchable

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
This commit is contained in:
B.Fatih KOZ 2021-11-02 16:00:29 +03:00 committed by GitHub
parent f498ad3bba
commit 9956929df7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,7 @@ class FlightRepository extends Repository implements CacheableInterface
protected $fieldSearchable = [ protected $fieldSearchable = [
'arr_airport_id', 'arr_airport_id',
'callsign',
'distance', 'distance',
'dpt_airport_id', 'dpt_airport_id',
'flight_type', 'flight_type',
@ -94,6 +95,10 @@ class FlightRepository extends Repository implements CacheableInterface
$where['flight_number'] = $request->input('flight_number'); $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') { if ($request->filled('flight_type') && $request->input('flight_type') !== '0') {
$where['flight_type'] = $request->input('flight_type'); $where['flight_type'] = $request->input('flight_type');
} }