@extends('admin.layouts.master') @section('header') @endsection @section('contents') @php $supportUser = $support->supportable; $userEmail = $supportUser ? (is_array($supportUser->email) ? '' : (string)($supportUser->email ?? '')) : ''; $userName = $supportUser ? (is_array($supportUser->name) ? '' : (string)($supportUser->name ?? '-')) : '-'; $userImage = $supportUser ? (is_array($supportUser->image) ? '' : (string)($supportUser->image ?? '')) : ''; $userUsername = $supportUser ? (is_array($supportUser->username) ? '' : (string)($supportUser->username ?? '')) : ''; $supportTypeLabel = $support->type ? (function($v){ return is_array($v) ? implode(', ', $v) : (string)$v; })(getTrans($support->type->display_name, lang())) : '-'; $supportTitle = is_array($support->title) ? '' : (string)($support->title ?? ''); $supportBody = is_array($support->body) ? '' : (string)($support->body ?? '-'); $supportPriority = is_array($support->priority) ? '' : (string)($support->priority ?? ''); $supportStatus = is_array($support->status) ? '' : (string)($support->status ?? ''); $supportImage = is_array($support->image) ? '' : (string)($support->image ?? ''); $adminUser = auth()->user(); $adminName = $adminUser ? (is_array($adminUser->name) ? '' : (string)($adminUser->name ?? '')) : ''; $adminImage = $adminUser ? (is_array($adminUser->image) ? '' : (string)($adminUser->image ?? '')) : ''; $adminId = $adminUser ? $adminUser->id : 0; @endphp
{{-- Breadcrumb --}}
{{-- Mobile sidebar toggle (visible on small screens only) --}}
{{-- ══════════ LEFT SIDEBAR ══════════ --}}
{{-- User banner --}}
#{{ $support->id }} {{ $userName }}
{{ $userName }}
{{ $userEmail }}
{{-- Ticket meta --}}
{{ __('Type') }} {{ $supportTypeLabel }}
{{ __('Priority') }} {{ $supportPriority ?: '-' }}
{{ __('Status') }} {{ ucfirst($supportStatus) }}
{{ __('Created') }} {{ $support->created_at->format('Y-m-d H:i') }}
{{ __('Messages') }} {{ $support->threads->count() }}
{{-- Description --}}
{{ $supportTitle }}
{{ $supportBody }}
{{-- Attached image --}} @if($supportImage)
attachment
@endif {{-- Controls --}}
{{-- ══════════ END SIDEBAR ══════════ --}}
{{-- ══════════ END GRID ══════════ --}}
{{-- end ticket-layout-row --}} {{-- ══════════ CHAT PANEL (برا ticket-layout-row، جوه ticket-outer) ══════════ --}}
{{-- Chat header --}}
{{ $userName }} {{ $support->threads->count() }} {{ __('dash.messages_word') }}
{{-- Messages --}}
@if($support->threads->count() > 0) @foreach($support->threads as $thread) @if(isset($thread->senderable)) @php $isAdmin = $thread->senderable_type === "App\Models\Admin"; $senderUsername = !$isAdmin ? (is_array($thread->senderable->username) ? '' : (string)($thread->senderable->username ?? '')) : ''; $profileUrl = $isAdmin ? route('admins.show', $thread->senderable->id) : route('freelancers.details', $senderUsername); $senderName = is_array($thread->senderable->name) ? '' : (string)($thread->senderable->name ?? ''); $senderImage = is_array($thread->senderable->image) ? '' : (string)($thread->senderable->image ?? ''); $threadMessage = is_array($thread->message) ? '' : (string)($thread->message ?? ''); $threadImages = is_array($thread->images) ? $thread->images : []; @endphp
@if($threadMessage)

{{ $threadMessage }}

@endif @foreach($threadImages as $file) @php $fileUrl = is_array($file) ? '' : (string)$file; @endphp @if($fileUrl) attachment @endif @endforeach
{{ $thread->created_at->format('Y-m-d H:i') }} @can('update_supports') @endcan
@endif @endforeach @else

{{ __('No messages yet. Start the conversation.') }}

@endif
{{-- File preview --}}
{{-- Input bar --}}
{{-- ══════════ END CHAT ══════════ --}}
{{-- end ticket-outer --}}
@can('update_supports') @endcan @endsection @section('scripts') @endsection