HomeController
extends BaseController
in package
Table of Contents
Methods
- airportInfoByLocId() : stdClass
- This function is used to retrieve detailed airport information by location ID with caching support.
- index() : string
- This function is used to display comprehensive home page with dynamic content and caching support.
- indexInfo() : string|View
- This function is used to display comprehensive airport information page with terminal details and related data.
- store() : JsonResponse
- This function is used to process contact form submission with validation and email notifications.
Methods
airportInfoByLocId()
This function is used to retrieve detailed airport information by location ID with caching support.
public
airportInfoByLocId(string $locid) : stdClass
This method fetches comprehensive airport information from an external GIS API using a cached approach to improve performance. It retrieves airport details including location ID, name, address, contact information, official website, manager details, and geometric data. Returns a standardized airport object with default values when API data is unavailable.
Parameters
- $locid : string
-
The airport location identifier (case-insensitive, will be lowercased internally)
Tags
Return values
stdClass —Airport information object containing:
- locid: Airport location identifier
- airport: Airport name
- airport_address: Physical address of the airport
- airport_contact_number: Contact phone number
- official_website: Airport's official website URL
- manager_name: Airport manager's name
- manager_address: Manager's address
- manager_csz: Manager's city, state, zip
- manager_phone: Manager's phone number
- geom: Geometric/geospatial data (JSON format)
index()
This function is used to display comprehensive home page with dynamic content and caching support.
public
index(Request $request) : string
This method renders the home page by retrieving and processing various content types including slider data, section content, gallery images, testimonials, and major airport information. It implements caching for non-authenticated users, processes content placeholders, and generates a complete home page with navigation and layout data.
Parameters
- $request : Request
-
The HTTP request instance
Tags
Return values
string —The rendered HTML content for the home page
indexInfo()
This function is used to display comprehensive airport information page with terminal details and related data.
public
indexInfo(Request $request, MetaService $metaService) : string|View
This method processes airport information requests by retrieving airport data from external GIS API, matching it with internal database records (Airports19k and AirportsAirportflyer), gathering terminal information, counts for rental cars, parking, and hotels, and generating SEO metadata. It handles various edge cases including missing ICAO identifiers, airport title fallbacks, and error scenarios. Returns either the rendered airport information page or appropriate 404 error views.
Parameters
- $request : Request
-
The HTTP request instance containing airport code in URL segments
- $metaService : MetaService
-
Service for generating SEO metadata for airport pages
Tags
Return values
string|View —The rendered HTML content for the airport information page, or a 404 error view
store()
This function is used to process contact form submission with validation and email notifications.
public
store(Request $request) : JsonResponse
This method handles contact form submissions with comprehensive validation including reCAPTCHA verification. It processes legitimate inquiries by storing data in the database and sending email notifications to administrators, while filtering out spam submissions. It includes business type processing and purpose categorization for better inquiry management.
Parameters
- $request : Request
-
The HTTP request instance
Tags
Return values
JsonResponse —JSON response indicating submission success or failure