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

Maintenance Details

Comprehensive details of the maintenance report.

Back to List
{{-- Basic Information & Category --}}
General Information
Category ID {{ $maintenance->category->id ?? 'N/A' }}
Category Name @if ($maintenance->category && $maintenance->category->icon) @endif {{ $maintenance->category->name ?? 'N/A' }}
Reported At {{ $maintenance->created_at->format('M d, Y h:i A') }}

{{ $maintenance->description ?? 'No description provided' }}

{{-- Reporter Details --}}
Reporter Details
@if ($maintenance->user && $maintenance->user->avatar) @else
@endif
{{ $maintenance->user->name ?? 'Unknown User' }}

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

{{ $maintenance->user->email ?? 'N/A' }}

{{ $maintenance->user->phone ?? 'N/A' }}

{{-- Property Details --}}
Property Details
@if ($maintenance->property)
Property ID {{ $maintenance->property->id }}
Property Name {{ $maintenance->property->property_name }}
Address {{ $maintenance->property->property_address }}
Number of Units {{ $maintenance->property->number_of_units }}
{{ strtoupper(substr($maintenance->property->user->name ?? 'N', 0, 1)) }}
{{ $maintenance->property->user->name ?? 'N/A' }}

Owner ID: {{ $maintenance->property->user->id ?? 'N/A' }}

{{ $maintenance->property->user->email ?? 'N/A' }}
{{ $maintenance->property->user->phone ?? 'N/A' }}
@else

No property information linked.

@endif
@if (!empty($maintenance->attachments))
Attachments
@foreach ($maintenance->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', 'aif']) || str_contains($attachment, 'premium_photo') || str_contains($attachment, 'unsplash.com')) @elseif($extension == 'pdf') @else @endif
@endforeach
@endif
@endsection