Hide a round trip's return leg from the Bookings list
Showing both legs as separate rows read as two unrelated bookings rather than one round trip. The list now only queries outbound/primary legs; the return leg is still reachable via the outbound leg's existing "Linked Leg" link on the detail page.
This commit is contained in:
@@ -28,9 +28,16 @@ class BookingsTable
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->modifyQueryUsing(fn (Builder $query) => $query->with([
|
||||
'route.company', 'route.fromDestination', 'route.toDestination', 'timeSlot', 'vehicleOptions',
|
||||
]))
|
||||
->modifyQueryUsing(fn (Builder $query) => $query
|
||||
// A round trip's return leg is its own Booking row, but
|
||||
// showing both legs side by side in one list reads as two
|
||||
// unrelated bookings rather than one round trip — hide it
|
||||
// here; it's still reachable via the primary leg's "Linked
|
||||
// Leg" link on the detail page (view its own row directly).
|
||||
->where('is_return_leg', false)
|
||||
->with([
|
||||
'route.company', 'route.fromDestination', 'route.toDestination', 'timeSlot', 'vehicleOptions',
|
||||
]))
|
||||
->defaultSort('created_at', 'desc')
|
||||
->columns([
|
||||
TextColumn::make('booking_ref')
|
||||
|
||||
Reference in New Issue
Block a user