Search for available trips with a GET request:
GET /search-trips
GET /search-trips?trip_date=2025-08-18&route_start_id=2&route_end_id=2&coach_no=101&schedule_id=1
{
"status": "success",
"code": 200,
"message": "Active trips retrieved successfully",
"data": {
"trips": {
"current_page": 1,
"data": [
{
"trip_id": 3,
"trip_date": "2025-08-18",
"trip_date_formatted": "Monday, August 18, 2025",
"status": 1,
"status_name": "Active",
"coach_type": 1,
"coach_type_name": "AC",
"current_partition": "trip_instances_202508",
"coach_id": 2,
"coach_no": "101",
"coach_seat_plan_id": 1,
"coach_status": 1,
"bus_id": 1,
"bus_registration_number": "123",
"bus_manufacturer": "ad",
"bus_model_year": 2000,
"schedule_id": 1,
"schedule_name": "11:00",
"route_id": 1,
"start_id": 2,
"end_id": 2,
"distance": 1300,
"duration": "02:45",
"start_district_name": "Updated District 1",
"end_district_name": "Updated District 1",
"route_display": "Updated District 1 → Updated District 1",
"driver_id": null,
"driver_name": null,
"driver_contact": null,
"driver_license": null,
"supervisor_id": null,
"supervisor_name": null,
"supervisor_contact": null,
"seat_plan_id": 1,
"seat_plan_name": "Bus A",
"seat_plan_floors": null,
"seat_plan_rows": 6,
"seat_plan_cols": 4,
"total_seats": 0,
"seat_inventory_summary": {
"total_seats": 0,
"available_seats": 0,
"booked_seats": 0,
"blocked_seats": 0,
"occupancy_percentage": 0,
"has_inventory": true
},
"is_ac": true,
"is_active": true,
"is_migrated": false,
"created_at": "2025-08-14T10:22:04.000000Z",
"updated_at": "2025-08-14T10:22:04.000000Z"
}
],
"first_page_url": "http://127.0.0.1:8000/api/search-trips?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://127.0.0.1:8000/api/search-trips?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://127.0.0.1:8000/api/search-trips?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://127.0.0.1:8000/api/search-trips",
"per_page": 15,
"prev_page_url": null,
"to": 1,
"total": 1
},
"search_criteria": {
"trip_date": "2025-08-18",
"route_start_id": 2,
"route_end_id": 2,
"coach_no": null,
"schedule_id": null
},
"total_trips": 1,
"boarding_counters": [
{
"id": 1,
"type": "1",
"address": "Dhaka",
"land_mark": null,
"location_url": null,
"phone": null,
"mobile": null,
"email": null,
"primary_contact_no": null,
"country": null,
"district_id": 1,
"booking_allowed_status": "1",
"booking_allowed_class": "1",
"no_of_boarding_allowed": null,
"sms_status": "1",
"status": "1",
"created_by": 1,
"updated_by": null,
"created_at": "2025-09-03T14:23:13.000000Z",
"updated_at": null,
"deleted_at": null
}
],
"dropping_counters": [
{
"id": 2,
"type": "1",
"address": "Chittagong",
"land_mark": null,
"location_url": null,
"phone": null,
"mobile": null,
"email": null,
"primary_contact_no": null,
"country": null,
"district_id": 2,
"booking_allowed_status": "1",
"booking_allowed_class": "1",
"no_of_boarding_allowed": null,
"sms_status": "1",
"status": "1",
"created_by": 1,
"updated_by": null,
"created_at": "2025-09-03T14:23:13.000000Z",
"updated_at": null,
"deleted_at": null
}
]
}
}
The response includes standard Laravel pagination with links, page numbers, and navigation URLs for easy frontend implementation.
The current_partition field shows which database partition is being used for the trip data, formatted as "trip_instances_YYYYMM".
{
"status": "error",
"code": 400,
"message": "Required parameters missing",
"errors": {
"trip_date": ["Trip date is required"],
"route_start_id": ["Start location is required"],
"route_end_id": ["End location is required"]
}
}
{
"status": "success",
"code": 200,
"message": "No trips found matching the criteria",
"data": {
"trips": {
"current_page": 1,
"data": [],
"total": 0
},
"search_criteria": {
"trip_date": "2025-08-18",
"route_start_id": 2,
"route_end_id": 3
},
"total_trips": 0
}
}