@extends('admin.layout') @section('content')
@php $vendori = App\Models\Vendor::Where('id', $ticket->user_id)->first(); @endphp
{{ __('Ticket Details') . ' -' }} {{ $vendori->username }}

{{ $ticket->subject }}

@if ($ticket->status != 3)
@csrf
@endif
@if ($ticket->status == 1) {{ __('Pending') }} @elseif($ticket->status == 2) {{ __('Open') }} @else {{ __('Closed') }} @endif {{ date('dS F Y, h.i A', strtotime($ticket->created_at)) }}

{!! $ticket->description !!}

@if ($ticket->attachment) {{ __('Download Attachment') }} @endif
{{ __('Replies') }}
@if (count($ticket->messages) > 0) @foreach ($ticket->messages as $reply) @if ($reply->type == 2) @php $admin = App\Models\Admin::where('id', $reply->user_id)->first(); @endphp
...
{{ $admin->username }}
{{ $admin->id == 1 ? 'Super Admin' : $admin->role->name }}

{!! $reply->reply !!}

@if ($reply->file) {{ __('Download') }} @endif
@else @if ($reply->type == 1) @php $user = App\Models\User::where('id', $ticket->user_id)->first(); @endphp
@if ($user->image) user-photo @else user-photo @endif
{{ $user->username }}
{{ __('Customer') }}

{!! $reply->reply !!}

@if ($reply->file) {{ __('Download') }} @endif
@elseif ($reply->type == 3) @php $vendor = App\Models\Vendor::where('id', $ticket->user_id)->first(); @endphp
@if ($vendor) @if ($vendor->photo) user-photo @else user-photo @endif @else user-photo @endif
{{ __('Vendor') }}

{!! $reply->reply !!}

@if ($reply->file) {{ __('Download') }} @endif
@endif @endif @endforeach @endif
@if ($ticket->status != 3)
{{ __('Reply to Ticket') }}
@csrf
@error('reply')

{{ $message }}

@enderror
@error('file')

{{ $message }}

@enderror

{{ __('Upload only ZIP Files, Max File Size is 20 MB') }}

@endif
@endsection @section('script') @endsection