Airport Guide Documentation

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
author

Airport Guide System

version
1.0

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
uses
TerminalDetails

Model to query terminal information from database

uses
strtoupper()

To normalize airport code for case-insensitive matching

see
Response::json()

To return JSON formatted response

note

Only terminals with terminal_status = 1 (active) are returned

note

Results are ordered first by sort_by (ASC), then by id (ASC) for consistent ordering

note

Returns empty array if no active terminals are found for the given airport code

note

The airport code parameter is case-insensitive (automatically uppercased)

example

GET /api/get-terminals-by-airport/JFK Returns: [{"id":1,"code_airport":"JFK","terminal_name":"Terminal 1","terminal_alias":"terminal-1","sort_by":1}, ...]

example

GET /api/get-terminals-by-airport/lax Returns: [{"id":5,"code_airport":"LAX","terminal_name":"Tom Bradley International Terminal","terminal_alias":"tb-it","sort_by":3}, ...]

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

        
On this page

Search results