@extends('layouts.admin') @section('content')

Cost Breakdown

Cost Breakdown List
Cost Breakdown
@if($estimatedCost)
Estimated Cost Per Person: AED {{ $estimatedCost->price_range }}
@else
Estimated cost per person has not been set yet.
@endif
@foreach($costBreakdowns as $key => $cost) @endforeach
Sl No Item Price
{{ $loop->iteration }} {{ $cost->item }} AED {{ $cost->price }}
@foreach($costBreakdowns as $key => $cost) @endforeach
Sl No Item Actions
{{ $loop->iteration }} @if($cost->items->isNotEmpty()) @php // Get the first item that is a main item (parent_id is null) $mainItem = $cost->items->firstWhere('parent_id', null); $subItems = $cost->items->where('parent_id', '!=', null); @endphp @if($mainItem) {{ $mainItem->item }}: AED {{ $mainItem->price }} @else No main item found. @endif @else No items available. @endif @if($subItems->isNotEmpty())
    @foreach($subItems as $item) @if($item->parent_id !== null)
  • {{ $item->item }}: AED {{ $item->price }} @if($item->subItems->isNotEmpty())
      @foreach($item->subItems as $subItem)
    • {{ $subItem->item }}: AED {{ $subItem->price }}
    • @endforeach
    @endif
  • @endif @endforeach
@else @endif
@endsection @section('script') @endsection