AirportController
extends BaseController
in package
Airport Controller
This controller manages comprehensive airport operations including airport CRUD, image management, file uploads, and airport information management. It provides extensive functionality for managing airport data, images, diagrams, and related content with advanced filtering and search capabilities.
Table of Contents
Methods
- __construct() : void
- Create a new AirportController instance.
- airportImage() : View
- Show the form for managing airport images.
- changeMapDesc() : bool
- Change map description for airport images.
- create() : View
- Show the form for creating a new airport.
- deleteAllImage() : void
- Delete all images for a specific airport.
- deleteDiagram() : void
- Delete airport diagram from storage.
- deleteImage() : void
- Delete airport image from storage.
- deleteParkingMap() : JsonResponse
- Delete parking map PDF for airport.
- deleteWebpImage() : void
- Delete airport WebP image from storage.
- destroy() : RedirectResponse
- Remove the specified airport from storage.
- edit() : View
- Show the form for editing the specified airport.
- index() : View|JsonResponse
- Display a listing of airports with DataTables support and advanced filtering.
- show() : void
- Display the specified airport details.
- store() : RedirectResponse
- Store a newly created airport in storage.
- update() : RedirectResponse
- Update the specified airport in storage.
- updateFlag() : bool
- Update flag status for airport images.
- upload() : JsonResponse
- Upload files for airport content management.
- UploadImageToServer() : void
- Upload image to server with comprehensive image processing.
- uploadMapPdf() : JsonResponse
- Upload parking map PDF for airport.
Methods
__construct()
Create a new AirportController instance.
public
__construct() : void
Checks if user is logged in and has proper permissions for airport management. Redirects to appropriate page if permissions are not met.
airportImage()
Show the form for managing airport images.
public
airportImage(int $id, Request $request) : View
Displays the airport image management interface with security key validation. Provides comprehensive image management for different airport image types.
Parameters
- $id : int
- $request : Request
Return values
ViewchangeMapDesc()
Change map description for airport images.
public
changeMapDesc(Request $request, int $id) : bool
Updates the map description for a specific airport image.
Parameters
- $request : Request
- $id : int
Return values
boolcreate()
Show the form for creating a new airport.
public
create(Request $request) : View
Displays the airport creation form with all necessary dropdown data including states, hubs, ownership types, and roles for airport configuration.
Parameters
- $request : Request
Return values
ViewdeleteAllImage()
Delete all images for a specific airport.
public
deleteAllImage(Request $request, int $id) : void
Removes all image files and thumbnails for a specific airport. Supports various image types and formats.
Parameters
- $request : Request
- $id : int
deleteDiagram()
Delete airport diagram from storage.
public
deleteDiagram(int $id) : void
Removes airport diagram files from storage. Updates airport record to reflect diagram deletion.
Parameters
- $id : int
deleteImage()
Delete airport image from storage.
public
deleteImage(int $id) : void
Removes airport image files and thumbnails from storage. Updates airport record to reflect image deletion.
Parameters
- $id : int
deleteParkingMap()
Delete parking map PDF for airport.
public
deleteParkingMap(int $id) : JsonResponse
Removes parking map PDF files from storage. Updates airport image records to reflect PDF deletion.
Parameters
- $id : int
Return values
JsonResponsedeleteWebpImage()
Delete airport WebP image from storage.
public
deleteWebpImage(int $id) : void
Removes airport WebP image files from storage. Updates airport record to reflect WebP image deletion.
Parameters
- $id : int
destroy()
Remove the specified airport from storage.
public
destroy(int $id) : RedirectResponse
Deletes airport record and associated files (images, thumbnails). Logs the deletion activity for audit purposes.
Parameters
- $id : int
Return values
RedirectResponseedit()
Show the form for editing the specified airport.
public
edit(int $id, Request $request) : View
Displays the airport edit form with security key validation. Requires valid security key to prevent unauthorized access.
Parameters
- $id : int
- $request : Request
Return values
Viewindex()
Display a listing of airports with DataTables support and advanced filtering.
public
index(Request $request) : View|JsonResponse
Provides a paginated list of airports with comprehensive filtering capabilities. Supports AJAX requests for DataTables with search and filter functionality. Includes advanced filtering by airport name, city, state, and location ID.
Parameters
- $request : Request
Return values
View|JsonResponseshow()
Display the specified airport details.
public
show(int $id) : void
Shows detailed airport information in a formatted HTML table. Displays comprehensive airport data including ownership, hub, and current status.
Parameters
- $id : int
store()
Store a newly created airport in storage.
public
store(Request $request) : RedirectResponse
Validates airport input, handles image uploads, creates new airport record, and logs the activity. Supports image processing and thumbnail generation.
Parameters
- $request : Request
Return values
RedirectResponseupdate()
Update the specified airport in storage.
public
update(Request $request, int $id) : RedirectResponse
Handles airport profile updates including diagram uploads, 2FA configuration, and comprehensive data updates. Supports file processing and validation.
Parameters
- $request : Request
- $id : int
Return values
RedirectResponseupdateFlag()
Update flag status for airport images.
public
updateFlag(Request $request) : bool
Updates various flag statuses for airport images including main flag, shuttle flag, rental flag, parking flag, etc.
Parameters
- $request : Request
Return values
boolupload()
Upload files for airport content management.
public
upload(Request $request) : JsonResponse
Handles file uploads for airport content including images and documents. Supports various file types and formats for airport content management.
Parameters
- $request : Request
Return values
JsonResponseUploadImageToServer()
Upload image to server with comprehensive image processing.
public
UploadImageToServer(Request $request) : void
Handles various types of airport images including main photos, shuttle photos, rental photos, parking photos, hotel photos, and transportation images. Supports both regular and WebP image formats with automatic thumbnail generation.
Parameters
- $request : Request
uploadMapPdf()
Upload parking map PDF for airport.
public
uploadMapPdf(Request $request) : JsonResponse
Handles PDF upload for airport parking maps with validation. Creates directory structure and updates airport image records.
Parameters
- $request : Request