TerminalController
extends Controller
in package
Terminal API Controller
This controller provides API endpoints for retrieving terminal information. It serves as a RESTful API interface for accessing terminal data by airport code.
Tags
Table of Contents
Methods
- getTerminalByAirport() : JsonResponse
- This function is used to retrieve active terminal information for a specific airport via API.
Methods
getTerminalByAirport()
This function is used to retrieve active terminal information for a specific airport via API.
public
getTerminalByAirport(string $airport) : JsonResponse
This method queries the TerminalDetails model to fetch all active terminals associated with the provided airport code. It returns terminal information including ID, airport code, terminal name, terminal alias, and sort order. The results are filtered to only include active terminals (terminal_status = 1) and are sorted by sort order and ID for consistent display. The airport code parameter is automatically converted to uppercase for matching.
Parameters
- $airport : string
-
The airport code (ICAO or LOC identifier) - will be converted to uppercase
Tags
Return values
JsonResponse —JSON response containing array of terminal objects with:
- id: Terminal unique identifier
- code_airport: Airport code associated with the terminal
- terminal_name: Full name of the terminal
- terminal_alias: Alias/slug for the terminal (if available)
- sort_by: Sort order value for terminal display sequence