HotelsAirportflyerController
extends BaseController
in package
Hotels Airport Flyer Controller
This controller manages comprehensive airport hotel operations including hotel CRUD, DataTables integration, advanced filtering, and hotel information management. It provides functionality for managing airport hotels with search capabilities, pagination, and detailed hotel information display for airport services.
Table of Contents
Methods
- __construct() : void
- Create a new HotelsAirportflyerController instance.
- create() : View
- Show the form for creating a new airport hotel.
- destroy() : RedirectResponse
- Remove the specified airport hotel from storage.
- edit() : View
- Show the form for editing the specified airport hotel.
- index() : View|JsonResponse
- Display a listing of airport hotels with DataTables integration and advanced filtering.
- show() : void
- Display detailed information about a specific airport hotel.
- store() : RedirectResponse
- Store a newly created airport hotel in storage.
- update() : RedirectResponse
- Update the specified airport hotel in storage.
Methods
__construct()
Create a new HotelsAirportflyerController instance.
public
__construct() : void
Checks if user is logged in and has proper permissions for airport hotel management. Redirects to appropriate page if permissions are not met.
create()
Show the form for creating a new airport hotel.
public
create(Request $request) : View
Displays the hotel creation form with dropdown data for airports, states, and existing hotels. Initializes form fields and loads reference data for hotel creation.
Parameters
- $request : Request
Return values
Viewdestroy()
Remove the specified airport hotel from storage.
public
destroy(int $id) : RedirectResponse
Deletes the hotel record and logs the activity for audit purposes. Provides appropriate feedback message after successful deletion.
Parameters
- $id : int
Return values
RedirectResponseedit()
Show the form for editing the specified airport hotel.
public
edit(int $id, Request $request) : View
Validates user permissions and hotel ID before displaying the edit form. Includes security checks with MD5 hash validation for hotel access.
Parameters
- $id : int
- $request : Request
Return values
Viewindex()
Display a listing of airport hotels with DataTables integration and advanced filtering.
public
index(Request $request) : View|JsonResponse
Provides a paginated list of airport hotels with comprehensive search capabilities. Supports filtering by hotel name, address, city, state, phone, airport code, and data source. Includes DataTables functionality with custom columns and action buttons for CRUD operations.
Parameters
- $request : Request
Return values
View|JsonResponseshow()
Display detailed information about a specific airport hotel.
public
show(int $id, Request $request) : void
Shows comprehensive hotel information in a formatted HTML table. Displays hotel details including name, description, distance, address, contact info, and social media links for the specified hotel.
Parameters
- $id : int
- $request : Request
store()
Store a newly created airport hotel in storage.
public
store(Request $request) : RedirectResponse
Validates hotel data, processes airport information, and creates a new hotel record. Handles airport code extraction and logs the activity for audit purposes.
Parameters
- $request : Request
Return values
RedirectResponseupdate()
Update the specified airport hotel in storage.
public
update(Request $request, int $id) : RedirectResponse
Validates hotel data, processes airport information, and updates the hotel record. Handles airport code extraction and logs the activity for audit purposes. Maintains pagination and filter parameters for proper redirect.
Parameters
- $request : Request
- $id : int