@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
{{ $location !== '' ? $location : 'Location not specified' }}
Posted {{ $listing->created_at?->diffForHumans() ?? 'recently' }}
{{ $displayDescription }}
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