@php
$supportUserOnline = false;
if(auth()->user()->last_login) {
try {
$supportUserOnline = \Carbon\Carbon::parse(auth()->user()->last_login)->diffInMinutes(now()) < 10;
} catch (\Exception $e) {
$supportUserOnline = false;
}
}
@endphp
{{ $support->body }}
@if($support->image)
@endif
@if(count($support->threads) > 0)
@php
$lastDate = null;
@endphp
@foreach($support->threads as $thread)
@php
$threadDate = \Carbon\Carbon::parse($thread->created_at)->format('Y-m-d');
if ($threadDate !== $lastDate) {
$lastDate = $threadDate;
$dateCarbon = \Carbon\Carbon::parse($threadDate);
if ($dateCarbon->isToday()) {
$dateLabel = 'اليوم';
} elseif ($dateCarbon->isYesterday()) {
$dateLabel = 'أمس';
} else {
$dateLabel = $dateCarbon->format('d/m/Y');
}
} else {
$dateLabel = null;
}
@endphp
@if($dateLabel)
{{ $dateLabel }}
@endif
@if($thread->senderable_type == 'App\Models\Admin')
{{ $thread->message }}
@if(count($thread->images) > 0)
@foreach($thread->images as $image)
@endforeach
@endif
@else
{{ $thread->message }}
@if(count($thread->images) > 0)
@foreach($thread->images as $image)
@endforeach
@endif
@endif
@endforeach
@endif
@if($support->status == 'open')
@elseif($support->status == 'closed')
@lang('This ticket is closed. You cannot add new replies.')
@else
@lang('This ticket is pending. You can reply once it is opened by support team.')
@endif