@php
// Primary destination first, then the rest of the tagged ones, so the
// saved primary survives a round-trip through the ordered picker.
$selectedDestinationIds = array_map('strval', old('destination_ids', isset($item)
? collect([$item->destination_id])->concat($item->destinations->pluck('id'))->filter()->unique()->values()->all()
: []));
@endphp
{{-- The name is dropped by JS once the ordered picker takes over; keeping it
here means the field still submits (in DOM order) if the CDN ever fails. --}}
{{-- Hidden inputs mirror the picker in selection order; a native multiple
select always submits in DOM order, which would lose the primary pick. --}}
duration_days ?? '') }}'>
durationNightsOrDefault() : '') }}'>
Shown on the website as e.g. "4 Days 3 Nights".
Ticked packages appear in the home page's Upcoming Events section, soonest departure
first, and drop out by themselves the day after they depart. They stay in the normal package list too.
Any package with a departure date is hidden from the whole website once that date has passed
— listings, its detail page, search, saved packages and booking. Leave the date blank for packages that
run all year.
event_priority ?? 0) }}'>
Higher shows first; ties go to the soonest departure.
Admins can still book when website booking is disabled.
Price matrix
One row per person count and pick time, with the price each person
pays at every hotel type. Pick times come from the Pick Time Setup on the
destinations selected above; a row left on Any date is the rate used whenever no pick
time matches, so the usual setup is one Any-date row per person count, with seasonal rows layered
on top. Leave a hotel type's price blank to not sell that hotel type for the row.
Once this matrix has any price it is the only thing that prices the package — a
combination with no rate cannot be booked. Leave it empty to sell at the flat adult price.
@php
$hotelCategories = \App\Support\HotelCategories::ALL;
// Stored as one rate per hotel type; shown as one row per (pick time, persons)
// with a price column per hotel type.
$priceRows = old('prices', isset($item)
? $item->prices
->groupBy(fn ($price) => ($price->destination_pick_time_id ?? '').'|'.$price->persons)
->map(fn ($group) => [
'destination_pick_time_id' => $group->first()->destination_pick_time_id,
'persons' => $group->first()->persons,
'rates' => $group->mapWithKeys(fn ($price) => [$price->hotel_category => $price->price_per_person])->all(),
])
->values()
->all()
: []);
$priceRows = is_array($priceRows) ? $priceRows : [];
$nextPriceIndex = $priceRows ? ((int) max(array_keys($priceRows))) + 1 : 0;
// Every window is rendered in every row so a saved value always has an option
// to sit in; the script below hides the ones whose destination is not selected.
$pickTimeGroups = $destinations
->filter(fn ($destination) => ($pickTimesByDestination[$destination->id] ?? collect())->isNotEmpty())
->values();
// The same select, as a string the "Add price row" script stamps an index into.
$pickTimeSelectTemplate = '';
@endphp
No rows: this package keeps pricing from the section above.
adult_price ?? 0) }}'>
child_price ?? 0) }}'>
infant_price ?? 0) }}'>
seasonal_price ?? 0) }}'>
offer_price ?? 0) }}'>
agent_price ?? 0) }}'>
corporate_price ?? 0) }}'>
video_url ?? '') }}'>
is_featured ?? false) ? 'checked' : '' }}>
SEO
seo_title ?? '') }}'>
seo_keywords ?? '') }}'>
Day-by-day itinerary (optional)
Leave this empty if the package has no fixed itinerary. Otherwise add each day once, then add as many
events inside it as that day has — transfers, check-in, sightseeing, meals — each with its own time,
place and duration. Events show on the website in the order listed here.