@php use Illuminate\Support\Str; use Modules\Helpdesk\Models\TicketTimeLog; $currentUser = auth()->user(); $currentCompany = $currentUser?->company; $canSeeInternalNotes = (bool) ($currentCompany?->is_system_company ?? false) || Str::lower((string) ($currentCompany?->slug ?? '')) === 'mpba-limited' || Str::contains(Str::lower((string) ($currentCompany?->name ?? '')), 'mpba'); $visibleCommentCount = $ticket->comments->count(); $ticketTimeLogs = TicketTimeLog::query() ->with('user') ->where('ticket_id', $ticket->getKey()) ->orderByDesc('started_at') ->get(); @endphp
{{ $ticket->reference }} {{ $ticket->status->name }} {{ $ticket->priority->name }}

{{ $ticket->subject }}

Raised by {{ $ticket->owner?->name ?? 'Unknown user' }} · Assigned to {{ $ticket->agent?->name ?? 'Unassigned' }}

Back @can('update', $ticket) Edit @endcan

Ticket document

Request details

Original request content recorded against this helpdesk ticket.

{{ $ticket->reference }}
{!! $ticket->body !!}

Attachments

Supporting files

{{ $ticket->attachments->count() }} file{{ $ticket->attachments->count() === 1 ? '' : 's' }}
@can('update', $ticket)
@csrf

Add files

No files selected

@error('attachments')

{{ $message }}

@enderror @error('attachments.*')

{{ $message }}

@enderror
@endcan @if ($ticket->attachments->isEmpty())
No supporting files have been attached yet.
@else @endif

Conversation

Document responses

{{ $visibleCommentCount }} item{{ $visibleCommentCount === 1 ? '' : 's' }}
@if ($ticket->comments->isNotEmpty()) @include('helpdesk::partials.comment-thread', [ 'comments' => $ticket->comments, 'level' => 0, 'ticket' => $ticket, 'canSeeInternalNotes' => $canSeeInternalNotes, ]) @else
No responses yet.
@endif
@csrf

Response document

Add reply

Create a response, internal MPBA note or threaded document reply.

@if (session('ticket-comment-added'))
{{ session('ticket-comment-added') }}
@endif @if ($errors->any())
{{ $errors->first() }}
@endif @php $cannedResponseBodies = $cannedResponses ->mapWithKeys(function ($response) use ($ticket, $currentUser) { $body = (string) $response->body; $body = strtr($body, [ '{{ ticket . reference }}' => e((string) ($ticket->reference ?? '')), '{{ ticket . subject }}' => e((string) ($ticket->subject ?? '')), '{{ ticket . status }}' => e((string) ($ticket->status?->name ?? '')), '{{ ticket . priority }}' => e((string) ($ticket->priority?->name ?? '')), '{{ ticket . category }}' => e((string) ($ticket->category?->name ?? '')), '{{ ticket . project }}' => e((string) ($ticket->project?->title ?? '')), '{{ ticket . team }}' => e((string) ($ticket->team?->name ?? '')), '{{ requester . name }}' => e( (string) ($ticket->owner?->name ?? ($ticket->user?->name ?? '')), ), '{{ agent . name }}' => e( (string) ($ticket->agent?->name ?? ($currentUser?->name ?? '')), ), '{{ actor . name }}' => e((string) ($currentUser?->name ?? '')), '{{ ticket . url }}' => e( route('helpdesk.tickets.show', ['ticket' => $ticket->getKey()]), ), ]); $body = html_entity_decode($body, ENT_QUOTES | ENT_HTML5, 'UTF-8'); $body = preg_replace('/<\s*(script|style)[^>]*>.*?<\s*\/\s*\1\s*>/is', '', $body) ?: ''; $body = preg_replace('/\s+on[a-z]+\s*=\s*("[^"]*"|\'[^\']*\'|[^\s>]+)/i', '', $body) ?: ''; $body = preg_replace('/javascript\s*:/i', '', $body) ?: ''; $body = strip_tags( $body, '


Time log history

{{ $ticketTimeLogs->count() }} entries · {{ $this->formattedTimeSpent() }}

@forelse ($ticketTimeLogs as $timeLog)

{{ $timeLog->description ?: 'Time logged' }}

{{ $timeLog->user?->name ?? 'Unknown user' }} · {{ $timeLog->logged_at?->format('d M Y H:i') ?? $timeLog->created_at?->format('d M Y H:i') }}

@php $timeLogSeconds = max(0, (int) ($timeLog->seconds ?? ((int) $timeLog->minutes * 60))); @endphp {{ gmdate('H:i:s', $timeLogSeconds) }}
@empty
No time log entries yet.
@endforelse