CharterBusController
extends BaseController
in package
Charter Bus Controller
This controller manages comprehensive charter bus operations including charter bus CRUD, city management, airport integration, and charter bus information management. It provides functionality for managing charter bus data with advanced filtering, search capabilities, and airport-specific charter bus services.
Table of Contents
Methods
- __construct() : void
- Create a new CharterBusController instance.
- create() : View
- Show the form for creating a new charter bus.
- destroy() : RedirectResponse
- Remove the specified charter bus from storage.
- edit() : View
- Show the form for editing the specified charter bus.
- getCityCharter() : JsonResponse
- Get cities for charter bus based on airport selection.
- index() : View|JsonResponse
- Display a listing of charter buses with DataTables support and advanced filtering.
- show() : void
- Display the specified charter bus details.
- store() : RedirectResponse
- Store a newly created charter bus in storage.
- update() : RedirectResponse
- Update the specified charter bus in storage.
Methods
__construct()
Create a new CharterBusController instance.
public
__construct() : void
Checks if user is logged in and has proper permissions for charter bus management. Redirects to appropriate page if permissions are not met.
create()
Show the form for creating a new charter bus.
public
create(Request $request) : View
Displays the charter bus creation form with available airports and states for assignment and configuration.
Parameters
- $request : Request
Return values
Viewdestroy()
Remove the specified charter bus from storage.
public
destroy(int $id) : RedirectResponse
Deletes charter bus record and logs the deletion activity for audit purposes.
Parameters
- $id : int
Return values
RedirectResponseedit()
Show the form for editing the specified charter bus.
public
edit(int $id, Request $request) : View
Displays the charter bus edit form with security key validation. Requires valid security key to prevent unauthorized access. Loads comprehensive charter bus data for editing.
Parameters
- $id : int
- $request : Request
Return values
ViewgetCityCharter()
Get cities for charter bus based on airport selection.
public
getCityCharter(Request $request) : JsonResponse
Retrieves city information for a given airport code. Returns city data in JSON format for AJAX requests. Supports both new charter bus creation and editing scenarios.
Parameters
- $request : Request
Return values
JsonResponseindex()
Display a listing of charter buses with DataTables support and advanced filtering.
public
index(Request $request) : View|JsonResponse
Provides a paginated list of charter buses with comprehensive filtering capabilities. Supports AJAX requests for DataTables with search and filter functionality. Includes advanced filtering by company name, address, phone, airport name, and airport code. Features charter bus preview, edit, and delete actions.
Parameters
- $request : Request
Return values
View|JsonResponseshow()
Display the specified charter bus details.
public
show(int $id, Request $request) : void
Shows detailed charter bus information in a formatted HTML table. Displays comprehensive charter bus data including company information, contact details, location, and service information.
Parameters
- $id : int
- $request : Request
store()
Store a newly created charter bus in storage.
public
store(Request $request) : RedirectResponse
Validates charter bus input, creates new charter bus record, and logs the activity. Supports comprehensive charter bus data including company information, contact details, and airport integration.
Parameters
- $request : Request
Return values
RedirectResponseupdate()
Update the specified charter bus in storage.
public
update(Request $request, int $id) : RedirectResponse
Handles charter bus updates including company information, contact details, airport integration, and location data. Validates input and tracks update activity.
Parameters
- $request : Request
- $id : int