@extends('admin.layouts.master') @section('content-header')

{{ trans('admin.preview') }} {{ $xPanel->entityName }}

@endsection @section('content') @if ($xPanel->hasAccess('list')) {{ trans('admin.back_to_all') }} {{ $xPanel->entityNamePlural }} @endif

{{ trans('admin.preview') }} {{ $xPanel->entityName }}

{{-- Main Details --}}
Main Details
ID {{ $entry->id }}
Model Type {{ $entry->model_type }}
Model ID {{ $entry->model_id }}
Action By (Admin ID) {{ $entry->admin_id }}
Activity Type {{ $entry->action }}
Reason {{ $entry->reason }}
Logged At {{ $entry->created_at }}
{{-- Updated Posts --}} @if ($entry->action === 'updated')
Changes
@php $changes = $entry->changes ?? []; @endphp @forelse ($changes as $field => $vals) @empty @endforelse
Field Old Value New Value
{{ $field }} @php $oldVal = $vals['old'] ?? 'N/A'; if (is_array($oldVal)) { $oldVal = implode(', ', $oldVal); } @endphp {{ $oldVal }} @php $newVal = $vals['new'] ?? 'N/A'; if (is_array($newVal)) { $newVal = implode(', ', $newVal); } @endphp {{ $newVal }}
No changes available
@endif {{-- Deleted Posts --}} @if ($entry->action === 'deleted') @php $deletedPost = is_string($entry->changes) ? json_decode($entry->changes, true) : $entry->changes; @endphp
Deleted Post Preview
{{-- Post Info & Pricing --}}
Post Information
Title {{ $deletedPost['title'] ?? 'N/A' }}
Description {!! $deletedPost['description'] ?? 'N/A' !!}
Created At {{ $deletedPost['created_at'] ?? 'N/A' }}
Updated At {{ $deletedPost['updated_at'] ?? 'N/A' }}
Pricing
Price {{ $deletedPost['price_formatted'] ?? 'N/A' }}
Negotiable {{ !empty($deletedPost['negotiable']) ? 'Yes' : 'No' }}
Sale Status {{ $deletedPost['saleStatus'] ?? 'N/A' }}
{{-- Category & Contact --}}
Category
Name {{ data_get($deletedPost, 'category.name.' . config('app.locale'), 'N/A') }}
Slug {{ data_get($deletedPost, 'category.slug', 'N/A') }}
Icon
Contact Information
Contact Name {{ $deletedPost['contact_name'] ?? 'N/A' }}
Email {{ $deletedPost['email'] ?? 'N/A' }}
Phone {{ $deletedPost['phone_intl'] ?? ($deletedPost['phone'] ?? 'N/A') }}
{{-- Post Pictures --}} @if (!empty($deletedPost['pictures']) && is_array($deletedPost['pictures'])) @php $images = collect($deletedPost['pictures'])->filter( fn($pic) => str_starts_with($pic['mime_type'] ?? '', 'image/'), ); $videos = collect($deletedPost['pictures'])->filter( fn($pic) => str_starts_with($pic['mime_type'] ?? '', 'video/'), ); @endphp {{-- Images Row --}} @if ($images->isNotEmpty())
Images
@foreach ($images as $image) @if (!empty($image['filename_url']))
Post Image
@endif @endforeach
@endif {{-- Videos Row --}} @if ($videos->isNotEmpty())
Videos
@foreach ($videos as $video) @if (!empty($video['filename_url']))
@endif @endforeach
@endif @endif
@endif
@endsection