@extends('layouts.app') @section('title')Support Tickets @endsection @section('content')

@if(Auth::user()->user_role == 1) {{ __('All Support Tickets') }} @else {{ __('My Support Tickets') }} @endif

@if(Auth::user()->user_role == 1) @endif @foreach($tickets as $ticket) @php $isNewForUser = (Auth::user()->user_role == 1 && $ticket->isNewForAdmin()) || (Auth::user()->user_role != 1 && $ticket->isNewForUser()); @endphp @php $cat = $ticket->category ?? ''; if ($cat === 'it') { $categoryLabel = 'Technical Support'; } elseif ($cat === 'account') { $categoryLabel = 'Account Manager'; } elseif ($cat === 'admin') { $categoryLabel = 'Admin'; } else { $categoryLabel = $cat ? ucfirst($cat) : '—'; } @endphp @if(Auth::user()->user_role == 1) @endif @endforeach
Ticket # Subject CategoryCreated ByStatus Priority Replies Files Created Last Updated Actions
#{{ $ticket->ticket_number }} @if($isNewForUser) New @endif
{{ $ticket->subject }}
{{ Str::limit($ticket->description, 50) }}
{{ $categoryLabel }}{{ $ticket->user->name. ' ' . $ticket->user->last_name }} {{ ucfirst(str_replace('_', ' ', $ticket->status)) }} {{ ucfirst($ticket->priority) }} @if($ticket->messages->count() > 0) {{ $ticket->messages->count() }} @else 0 @endif @if($ticket->attachments->count() > 0) {{ $ticket->attachments->count() }} @else 0 @endif {{ $ticket->created_at->format('Y-m-d H:i') }} {{ $ticket->updated_at->format('Y-m-d H:i') }} @if(Auth::user()->user_role == 1 && $ticket->assignedTo) @endif
@endsection