Airport Guide Documentation

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
see
getInfoByCurlCache()

To fetch airport info from GIS API with file-based caching

see
md5()

To generate cache filename from location ID

see
data_get()

To safely extract nested array data from API response

note

Cache duration is set to 2880 minutes (48 hours) for airport information

note

Cache files are stored in 'site_content/airport-info' directory

note

Returns default values ('-') for all fields when API data is unavailable

note

The location ID parameter is automatically lowercased before processing

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
see
Request::session()

To get the session instance

see
Cache::has()

To check for cached content

see
Cache::get()

To retrieve cached content

see
Cache::put()

To store cached content

see
GlobalSetting

Model to retrieve global settings

see
Menu

Model to retrieve navigation menu data

see
Page

Model to retrieve home page content and testimonials

see
GalleryDetail

Model to retrieve slider information

see
GalleryPhoto

Model to retrieve gallery images

see
Section

Model to process section content

see
State

Model to retrieve airport information

see
DB::table()

To query major airport data

see
getSlider()

To generate slider HTML content

see
getSection()

To process section placeholders

see
getGallery()

To process gallery placeholders

see
view()

For rendering the home page template

see
config()

To retrieve application constants

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
see
Request::segments()

To extract airport code from URL path

see
getInfoByCurl()

To fetch airport information from external GIS API (gis.geosphere.io)

see
Airports19k

Model to match airport by ICAO identifier or LOC ID

see
getAirportIdByCiasIdentifier()

To retrieve airport ID data by ICAO identifier

see
airportInfoByLocId()

To fetch detailed airport information by location ID

see
AirportsAirportflyer

Model to retrieve airport title and display information

see
MetaService::getAirportInfoMeta()

To generate SEO metadata (title, description, keywords)

see
GlobalSetting

Model to retrieve global application settings

see
TerminalDetails

Model to fetch active terminal information for the airport

see
getCountAllData()

To count available rental cars, parking spaces, and hotels

see
AirportImages

Model to retrieve airport image data

see
getContentUrlImg()

To generate content URL for airport images

see
view()

To render the 'Frontend/airport-info' template

see
Response::view()

To return 404 error views when airport is not found

throws
Exception

When external API calls fail or database queries encounter errors

note

The method expects the airport code to be the first segment of the URL path

note

Returns 404 views ('Frontend/Dynamic/404' or 'Frontend/Dynamic/404-airport-info') when:

  • External API returns an error response
  • Airport data cannot be found in Airports19k database
  • No responseJSON data is available from the external API
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
see
Request::validate()

To validate form input with custom rules

see
Recaptcha

Rule to validate reCAPTCHA response

see
GlobalSetting

Model to retrieve global settings

see
ContactEnquiries

Model to store inquiry data

see
Mail::to()

To send email notifications

see
DemoMail

To format and send email content

see
Response::json()

To return JSON responses

see
config()

To retrieve email configuration

throws
Exception

When email sending fails

Return values
JsonResponse

JSON response indicating submission success or failure


        
On this page

Search results