@inject('carbon', 'Carbon\Carbon') @inject('parameter', 'App\Models\Parameter') @php $checkinFirst = request('checkin_first'); $checkinLast = request('checkin_last'); $checkinFirstDate = $carbon::parse($checkinFirst); $checkinLastDate = $carbon::parse($checkinLast); $numberOfDays = $checkinFirstDate->diffInDays($checkinLastDate); @endphp @foreach($properties as $property)
@if ($property->images) @php $images = json_decode($property->images, true); $firstImage = $images[0]['@value'] ?? null; @endphp @if ($firstImage) {{ $property->name }} @endif @endif
{{ $property->name }}
{{ $property->current_price }} TND / Nuit {{ $property->current_price }} x {{ $numberOfDays }} = {{ $property->current_price * $numberOfDays }} TND

Frais de nettoyage: {{ number_format($property->cleaning_fee, 2, ',', ' ') }} TND

@php $totalPrice = $property->current_price * $numberOfDays; $serviceFees = ($totalPrice + $property->cleaning_fee) * ($parameter::getMostRecentParameter()->service_charge / 100); @endphp

Frais de service: {{ number_format($serviceFees, 2, ',', ' ') }} TND

Total: {{ number_format($totalPrice + $serviceFees + $property->cleaning_fee, 2, ',', ' ') }} TND

{{--
@csrf
--}}
@endforeach