Airport Guide Documentation

TransportReservationController extends BaseController
in package

Transport Reservation Management Controller

This controller handles all operations related to transport reservation management. It provides functionality for viewing and managing transport reservations made through the Mozio transport booking system. The controller includes features for listing reservations with search and filtering capabilities, viewing detailed reservation information, and admin activity logging.

Features:

  • DataTables integration with search and filtering
  • Direct database table access for Mozio transport reservations
  • Advanced filtering by customer name, email, airline, and location ID
  • Detailed reservation information display
  • Admin activity logging for operations
  • Date formatting for pickup times
  • Customer contact information management
  • Flight and location tracking
Tags
author

Airport Guide System

version
1.0
since
2024

Table of Contents

Methods

__construct()  : void
Constructor for TransportReservationController
destroy()  : RedirectResponse
Remove the specified transport reservation resource from storage
index()  : View|DataTable
Display a listing of transport reservation resources
show()  : void
Display the specified transport reservation resource

Methods

__construct()

Constructor for TransportReservationController

public __construct() : void

Initializes the controller by checking user authentication and permissions. Redirects to login if user is not authenticated or lacks proper permissions.

destroy()

Remove the specified transport reservation resource from storage

public destroy(int $id) : RedirectResponse

Deletes a transport reservation record and creates an admin activity log entry. This method appears to be incomplete or may be a placeholder for future functionality. Currently references PublicTransportation model instead of MozioTransportReservation.

Parameters
$id : int

The ID of the transport reservation record to delete

Tags
example

DELETE /admin/transport-reservation/123

Note: This method may need to be updated to properly handle transport reservation deletion

Return values
RedirectResponse

Redirects to transportation index with success message

index()

Display a listing of transport reservation resources

public index(Request $request) : View|DataTable

This method handles both AJAX and regular requests for displaying transport reservation data. For AJAX requests, it returns DataTables formatted data with advanced search and filtering capabilities. For regular requests, it returns a view with pagination and search filters.

Features:

  • Pagination support with configurable page size
  • Advanced search filtering by first name, email, airline, and location ID
  • DataTables integration for enhanced user experience
  • Action buttons for viewing reservation details
  • Case-insensitive search with string contains filtering
  • Direct database table access for real-time data
  • Filter state preservation in action URLs
Parameters
$request : Request

The HTTP request object containing search parameters and pagination data

Tags
example

// Regular request GET /admin/transport-reservation

// AJAX request with search filters GET /admin/transport-reservation?ajax=1&first_name=John&airline=Delta&loc_id=JFK

Return values
View|DataTable

Returns view for regular requests or DataTable for AJAX

show()

Display the specified transport reservation resource

public show(int $id, Request $request) : void

Shows detailed information about a specific transport reservation in HTML format. This method is typically called via AJAX to display reservation data in a modal window. Only displays fields that have values (non-empty) and formats dates for better readability.

Features:

  • Comprehensive reservation details display
  • Date formatting for pickup times (e.g., "Jan 15, 2024 at 2:30 PM")
  • Customer contact information (name, email, phone, country code)
  • Flight information (airline, flight number)
  • Location and routing details (pickup from, drop to)
  • Pricing information (amount)
Parameters
$id : int

The ID of the transport reservation record to display

$request : Request

The HTTP request object

Return values
void

Outputs HTML content directly to the response


        
On this page

Search results