@php
// Use property object fields if available, otherwise fall back to props
$showForRent = $property
? ($property->is_for_rent === 'Y' || $property->is_for_rent === true)
: ($isForRent === true || $isForRent === 'Y');
$showForSale = $property
? ($property->is_for_sale === 'Y' || $property->is_for_sale === true)
: ($isForSale === true || $isForSale === 'Y');
$showFeatured = $property
? ($property->is_featured === 'Y' || $property->is_featured === true)
: ($isFeatured === true || $isFeatured === 'Y');
@endphp
@if($showForRent)
- For Rent
@endif
@if($showForSale)
- For Sale
@endif
@if($showFeatured)
- Featured
@endif
{{--
--}}
@php
// Determine price and unit from property if available, otherwise use props
$displayPrice = $price;
$displayPriceUnit = $priceUnit;
if ($property && $property->price) {
$isForSale = $property->is_for_sale === 'Y' || $property->is_for_sale === true;
$isForRent = $property->is_for_rent === 'Y' || $property->is_for_rent === true;
if ($isForSale && $property->price->sale_price) {
// Property is for sale - show sale_price
$displayPrice = '€' . number_format($property->price->sale_price, 0, '.', ',');
$displayPriceUnit = '';
} elseif ($isForRent && $property->price->rent_lt) {
// Property is for rent - show rent_lt with /pm
$displayPrice = '€' . number_format($property->price->rent_lt, 0, '.', ',');
$displayPriceUnit = '/mo';
}
}
@endphp
{{ $displayPrice }}{{ $displayPriceUnit }}