| {{$ticket->id}} |
{{$ticket->ticketCustomer->display_name ?? ''}} |
|
@php
// Decode the JSON fields to an associative array
$fieldsArray = json_decode($ticket->ticketFiled->fields, true);
// Check if 'contact-number' is set in the decoded array
if (isset($fieldsArray['contact-number'])) {
// If 'contact-number' is set, use it
$contactNumber = $fieldsArray['contact-number'];
} else {
// Otherwise, fall back to the mobile number
$contactNumber = $ticket->ticketCustomer->mobile_number;
}
@endphp
{{$contactNumber ?? '-'}}
|
{{$ticket->created_at->format('Y/m/d H:i:s')}} |
{{$ticket->ticketInfo->priority}} |
{{ optional($ticket->ticketCategories()->where('category_level_id', 2)->first()->category)->name }} |
{{ optional($ticket->ticketCategories()->where('category_level_id', 1)->first()->category)->name }} |
@php
echo optional(
$ticket->ticketActions()
->orderBy('created_at', 'asc')
->first()
)->comment ?? '';
@endphp
|
{{$ticket->ticketInfo->channel}} |
|
{{ optional($ticket->ticketCategories()->where('category_level_id', 1)->first()->category)->name }} |
@php
$id = optional($ticket->ticketActions()->where('department_id', 4)->first())->id ?? '' ;
if($id){
echo optional($ticket->ticketActions()->where('id','>', $id)->first())->comment ?? '' ;
}
@endphp
|
{{ optional($ticket->ticketActions()->latest()->first())->comment ?? '' }}
|
{{$ticket->updated_at->format('Y/m/d H:i:s')}} |
@php
$latestTicketAction = $ticket->ticketActions()->latest()->first();
@endphp
{{ optional($latestTicketAction->user)->first_name ?? '' }} {{ optional($latestTicketAction->user)->last_name ?? '' }}
|
{{ optional($ticket->ticketCategories()->where('category_level_id', 1)->first()->category)->name }} |
@php
if ($ticket->status == 'Closed') {
$day = $ticket->created_at->diffInDays($ticket->updated_at);
} else {
$day = $ticket->created_at->diffInDays(now());
}
$backgroundColor = '';
$dayYouHave = 0;
if ($categoryName === 'Complaints') {
$dayYouHave = 10;
if ($day == 9) {
$backgroundColor = 'yellow';
} elseif ($day >= 10) {
$backgroundColor = 'red';
}
} elseif ($categoryName === 'Requests') {
$dayYouHave = 3;
if ($day == 2) {
$backgroundColor = 'yellow';
} elseif ($day >= 3) {
$backgroundColor = 'red';
}
} elseif ($categoryName === 'SAMA complaint') {
$dayYouHave = 3;
if ($day == 2) {
$backgroundColor = 'yellow';
} elseif ($day >= 3) {
$backgroundColor = 'red';
}
} elseif ($categoryName === 'SAMA escalation') {
$dayYouHave = 2;
if ($day == 1) {
$backgroundColor = 'yellow';
} elseif ($day >= 2) {
$backgroundColor = 'red';
}
}
@endphp
{{ $day }}
|
{{ $dayYouHave }} |
{{ $ticket->status }} |
@empty