@if($pkg_type == 'single' && $groupedPromotions) @foreach($groupedPromotions as $promotionGroup)
{{ $promotionGroup['promotion']->name }}

{{ $promotionGroup['promotion']->name }}

{{ $promotionGroup['promotion']->description }}

@foreach($promotionGroup['items'] as $item) @php $title = __('messages.t_promotion_for_duration', [ 'promotionName' => $promotionGroup['promotion']->name, 'duration' => $item->promotion->package->duration ]); @endphp @if($promotionGroup['promotion']->id == 4 && in_array($item->id, $selectedItems))
{{ $this->form }}
@endif @endforeach
@endforeach @elseif($pkg_type == 'apply' && $activeOrderPackageItems)
@foreach($activeOrderPackageItems as $orderPackageItem) @if($orderPackageItem->promotion_id == 4 && in_array($orderPackageItem->id, $selectedItems))
{{ $this->form }}
@endif @endforeach
@else
@foreach($packages as $package)

{{ $package->name }} ({{ $package->duration }} {{ __('messages.t_days') }})

{{ $package->features }}

{{ __('messages.t_choose_ad_count') }}

{{ __('messages.t_select_ad_option') }}

@foreach($package->packageItems->whereNull('package_promotion_id') as $item) @endforeach
@php $groupedPromotions = $package->packagePromotions->groupBy('promotion.id'); @endphp @foreach($groupedPromotions as $promotionId => $group) @php $promotion = $group->first()->promotion; // Assuming all items in the group have the same promotion details @endphp

{{ $promotion->name }}

{{ $promotion->description }}

@foreach($group as $packagePromotion) @foreach($packagePromotion->packageItems as $item) @endforeach @endforeach
@endforeach
@endforeach
@endif