{{-- Page Header --}} {{-- Task Details Card --}}

Task Details

Status
{{ $task->status->label }}
Priority
@if($task->priority === 'critical') @elseif($task->priority === 'high') @elseif($task->priority === 'medium') @else @endif {{ ucfirst($task->priority) }}
@if($task->due_date)
Due Date
{{ $task->due_date->format('M d, Y') }}
@endif @if($task->estimated_hours)
Estimated Hours
{{ $task->estimated_hours }}h
@endif
@if($task->description)
Description
{{ $task->description }}
@endif
{{-- Related Entity Card (Project/Service/Contract/Support) --}} @php // Auto-detect task_type if not set but has related ID $detectedTaskType = $task->task_type ?? 'general'; if ($detectedTaskType == 'general' || !$detectedTaskType) { if ($task->project_id) $detectedTaskType = 'project'; elseif ($task->service_id) $detectedTaskType = 'service'; elseif ($task->contract_id) $detectedTaskType = 'contract'; elseif ($task->support_ticket_id) $detectedTaskType = 'support'; } @endphp @if($detectedTaskType !== 'general')

@if($detectedTaskType == 'project') Project Details @elseif($detectedTaskType == 'service') Service Details @elseif($detectedTaskType == 'contract') Contract Details @elseif($detectedTaskType == 'support') Support Ticket Details @endif

{{-- Task Type --}}
Task Type
{{ ucfirst($detectedTaskType) }} Task
@if($detectedTaskType == 'project') {{-- Project Info --}}
Project
@if($task->project) #{{ $task->project_id }} - {{ $task->project->title ?? $task->project->name ?? $task->related_name }} @else {{ $task->related_name ?? 'Project #'.$task->project_id }} @endif
@if($task->project) @if($task->project->status ?? null)
Project Status
@php $projectStatus = $task->project->status; $statusColor = '#3b82f6'; if (is_object($projectStatus)) { $statusLabel = $projectStatus->label ?? $projectStatus->name ?? 'Unknown'; $statusColor = $projectStatus->color ?? '#3b82f6'; } elseif (is_array($projectStatus)) { $statusLabel = $projectStatus['label'] ?? $projectStatus['name'] ?? 'Unknown'; $statusColor = $projectStatus['color'] ?? '#3b82f6'; } else { $statusLabel = ucfirst($projectStatus); } @endphp {{ $statusLabel }}
@endif @if($task->project->customer ?? null) @endif @if($task->project->start_date ?? null)
Project Start Date
{{ \Carbon\Carbon::parse($task->project->start_date)->format('M d, Y') }}
@endif @if($task->project->deadline ?? $task->project->due_date ?? $task->project->end_date ?? null)
Project Deadline
@php $deadline = $task->project->deadline ?? $task->project->due_date ?? $task->project->end_date; $deadlineDate = \Carbon\Carbon::parse($deadline); $isOverdue = $deadlineDate->isPast(); @endphp {{ $deadlineDate->format('M d, Y') }} @if($isOverdue) (Overdue) @endif
@endif @if(isset($task->project->progress))
Project Progress
{{ $task->project->progress }}%
@endif @if($task->project->billing_type ?? null)
Billing Type
{{ ucfirst(str_replace('_', ' ', $task->project->billing_type)) }}
@endif @if($task->project->hourly_rate ?? null)
Hourly Rate
β‚Ή{{ number_format($task->project->hourly_rate, 2) }}
@endif @if($task->project->total_budget ?? $task->project->project_cost ?? null)
Project Budget
β‚Ή{{ number_format($task->project->total_budget ?? $task->project->project_cost, 2) }}
@endif @if($task->project->description ?? null)
Project Description
{{ \Illuminate\Support\Str::limit(strip_tags($task->project->description), 200) }}
@endif @endif @elseif($detectedTaskType == 'service') {{-- Service Info --}}
Service
@if($task->service) #{{ $task->service_id }} - {{ $task->service->name ?? $task->related_name }} @else {{ $task->related_name ?? 'Service #'.$task->service_id }} @endif
@if($task->service) @if($task->service->price ?? null)
Service Price
{{ number_format($task->service->price, 2) }}
@endif @endif @elseif($detectedTaskType == 'contract') {{-- Contract Info --}}
Contract
@if($task->contract) #{{ $task->contract_id }} - {{ $task->contract->subject ?? $task->related_name }} @else {{ $task->related_name ?? 'Contract #'.$task->contract_id }} @endif
@if($task->contract) @if($task->contract->contract_value ?? null)
Contract Value
{{ number_format($task->contract->contract_value, 2) }}
@endif @if($task->contract->start_date ?? null)
Contract Period
{{ \Carbon\Carbon::parse($task->contract->start_date)->format('M d, Y') }} @if($task->contract->end_date ?? null) - {{ \Carbon\Carbon::parse($task->contract->end_date)->format('M d, Y') }} @endif
@endif @endif @elseif($detectedTaskType == 'support') {{-- Support Ticket Info --}}
Support Ticket
@if($task->supportTicket) [{{ $task->supportTicket->ticket_key ?? $task->support_ticket_id }}] {{ $task->supportTicket->subject ?? $task->related_name }} @else {{ $task->related_name ?? 'Ticket #'.$task->support_ticket_id }} @endif
@if($task->supportTicket) @if($task->supportTicket->status_id ?? $task->supportTicket->status ?? null)
Ticket Status
@php $ticketStatus = $task->supportTicket->status ?? null; $statusName = 'Unknown'; if (is_object($ticketStatus)) { $statusName = $ticketStatus->name ?? $ticketStatus->label ?? 'Unknown'; } elseif (is_string($ticketStatus)) { $statusName = ucfirst($ticketStatus); } elseif ($task->supportTicket->status_id) { $statusName = 'Status #' . $task->supportTicket->status_id; } @endphp {{ $statusName }}
@endif @if($task->supportTicket->priority_id ?? $task->supportTicket->priority ?? null)
Ticket Priority
@php $ticketPriority = $task->supportTicket->priority ?? null; $priorityName = 'Unknown'; if (is_object($ticketPriority)) { $priorityName = $ticketPriority->name ?? $ticketPriority->label ?? 'Unknown'; } elseif (is_string($ticketPriority)) { $priorityName = ucfirst($ticketPriority); } elseif ($task->supportTicket->priority_id) { $priorityName = 'Priority #' . $task->supportTicket->priority_id; } @endphp {{ $priorityName }}
@endif @if($task->supportTicket->department_id ?? null)
Department
@php $department = $task->supportTicket->department ?? null; $deptName = 'Unknown'; if (is_object($department)) { $deptName = $department->name ?? 'Unknown'; } elseif ($task->supportTicket->department_id) { $deptName = 'Department #' . $task->supportTicket->department_id; } @endphp {{ $deptName }}
@endif @if($task->supportTicket->customer_id ?? null)
Customer
{{ $task->supportTicket->name ?? $task->supportTicket->email ?? 'Customer #'.$task->supportTicket->customer_id }}
@endif @if($task->supportTicket->created_at ?? null)
Ticket Created
{{ \Carbon\Carbon::parse($task->supportTicket->created_at)->format('M d, Y h:i A') }}
@endif @if($task->supportTicket->message ?? null)
Ticket Message
{{ \Illuminate\Support\Str::limit(strip_tags($task->supportTicket->message), 200) }}
@endif @endif @endif
@endif {{-- Assigned To Card --}} @if($task->assignees && $task->assignees->count() > 0)

Assigned To

@foreach($task->assignees as $owner)
{{ $owner->name }}
@endforeach
@endif {{-- Attachments Card --}} @if($task->attachments && $task->attachments->count() > 0)

Attachments ({{ $task->attachments->count() }})

@foreach($task->attachments as $attachment)
@if($attachment->is_image)
{{ $attachment->filename }}
@else
@if($attachment->file_icon == 'file-pdf') @elseif($attachment->file_icon == 'file-image') @elseif($attachment->file_icon == 'file-archive') @else @endif
@endif
{{ $attachment->filename }}
{{ $attachment->file_size_human }} {{ $attachment->created_at->format('M d, Y') }}
@can('tasks.all-tasks.delete') @endcan
@endforeach
@endif {{-- Image Preview Modal --}}
Preview
{{-- SUMMARY DISPLAY CARD --}}

Task Summary

@if($task->summary) @php $summaryLength = strlen($task->summary); $isLong = $summaryLength > 500; @endphp
{!! nl2br(e($task->summary)) !!}
@if($isLong)
@endif
Last updated: {{ $task->updated_at->format('d M Y, h:i A') }}
@else

No summary added yet. Use the form below to add task summary.

@endif
@csrf
@if($task->summary) New content will be appended to existing summary with timestamp @else Describe task progress, findings, or important notes @endif
Click to upload or drag and drop
PDF, DOC, XLS, Images, ZIP (Max 1MB per file)
@error('attachments')
{{ $message }}
@enderror @error('attachments.*')
{{ $message }}
@enderror
Cancel