@extends('layouts.app') @section('content') @php $title = trim((string) ($listing->title ?? '')); $displayTitle = ($title !== '' && preg_match('/[\pL\pN]/u', $title)) ? $title : 'Untitled listing'; $city = trim((string) ($listing->city ?? '')); $country = trim((string) ($listing->country ?? '')); $location = implode(', ', array_filter([$city, $country], fn ($value) => $value !== '')); $description = trim((string) ($listing->description ?? '')); $displayDescription = ($description !== '' && preg_match('/[\pL\pN]/u', $description)) ? $description : 'No description provided.'; $hasPrice = !is_null($listing->price); $priceValue = $hasPrice ? (float) $listing->price : null; @endphp

{{ $displayTitle }}

@if($hasPrice) @if($priceValue > 0) {{ number_format($priceValue, 0) }} {{ $listing->currency ?? 'USD' }} @else Free @endif @else Price on request @endif

{{ $location !== '' ? $location : 'Location not specified' }}

Posted {{ $listing->created_at?->diffForHumans() ?? 'recently' }}

Description

{{ $displayDescription }}

Contact Seller

@if($listing->contact_phone)

Phone: {{ $listing->contact_phone }}

@endif @if($listing->contact_email)

Email: {{ $listing->contact_email }}

@endif @if(!$listing->contact_phone && !$listing->contact_email)

No contact details provided.

@endif
@endsection