@extends('backend.app') @section('title') {{ env('APP_NAME') }} || Announcement Details @endsection @section('content')

Announcement Details

Comprehensive details of the announcement.

Back to List
{{-- Basic Information --}}
General Information
{{-- --}}
Title {{ $announcement->title ?? 'N/A' }}
Category {{ $announcement->category->name ?? 'N/A' }}
Status @php $badgeClass = match ($announcement->status) { 'published', 'active' => 'bg-success', 'draft' => 'bg-warning', 'inactive', 'cancelled' => 'bg-danger', default => 'bg-secondary', }; @endphp {{ ucfirst($announcement->status) }}
Created At @if (is_string($announcement->created_at)) {{ \Carbon\Carbon::parse($announcement->created_at)->format('M d, Y h:i A') }} @else {{ $announcement->created_at->format('M d, Y h:i A') }} @endif
Publish Date {{ $announcement->publish_date ? \Carbon\Carbon::parse($announcement->publish_date)->format('M d, Y') : 'N/A' }}
{{-- Content --}}
Announcement Content
{!! nl2br(e($announcement->message)) !!}
{{-- Author Details --}}
Author Details
@if ($announcement->user && $announcement->user->avatar) @else
@endif
{{ $announcement->user->name ?? 'Unknown User' }}

User ID: {{ $announcement->user->id ?? 'N/A' }}

Email: {{ $announcement->user->email ?? 'N/A' }}

Phone: {{ $announcement->user->phone ?? 'N/A' }}

{{-- Property Details --}}
Linked Property
@if ($announcement->property)
{{ $announcement->property->property_name }}

{{ $announcement->property->property_address }}


Owner: {{ $announcement->property->user->name ?? 'N/A' }}

@else

No property information linked.

@endif
{{-- Attachments --}} @if (!empty($announcement->attachments))
Attachments
@foreach ($announcement->attachments as $attachment) @php $cleanPath = strtok($attachment, '?'); $extension = strtolower( pathinfo($cleanPath, PATHINFO_EXTENSION), ); $fileUrl = filter_var($attachment, FILTER_VALIDATE_URL) ? $attachment : asset('storage/' . $attachment); @endphp
@if (in_array($extension, ['jpg', 'jpeg', 'png', 'gif', 'webp']) || str_contains($attachment, 'premium_photo')) @elseif($extension == 'pdf') @else @endif
@endforeach
@endif
@endsection