@extends('layouts.master') @section('css') @endsection @section('title', 'Task Details') @section('content')

TASK DETAILS {{ ucfirst(str_replace('_', ' ', $task->status)) }}

{{ $task->title }}

{{ \Carbon\Carbon::parse($task->scheduled_at)->format('d M, Y') }}
@if (session('status')) @endif @if (session('error'))
@endif

Task Information

{{ $task->location_name ?? 'Not Specified' }} @if($task->latitude && $task->longitude)
View on Google Maps @endif

{{ $task->client ? $task->client->fullName() : 'Not Assigned' }}

@if($task->client && $task->client->phone) +{{ $task->client->phone }} @endif

{{ $task->assignedUser ? $task->assignedUser->fullName() : 'Not Assigned' }}

@if($task->assignedUser && $task->assignedUser->phone) +{{ $task->assignedUser->phone }} @endif

Description

{{ $task->description ?? 'No description provided.' }}
{{-- Edit Task --}} @can('update task') Edit Task @endcan {{-- Delete Task --}} @can('delete task')
@csrf @method('DELETE')
@endcan {{-- Notify Assigned User --}} @can('assign task') @if($task->assignedUser && $task->assignedUser->phone)
@csrf
@endif @endcan

Activity & Comments

@foreach($task->comments as $comment)
@if($comment->user->avatar) Avatar @else
{{ strtoupper(substr($comment->user->first_name, 0, 1)) }}{{ strtoupper(substr($comment->user->last_name, 0, 1)) }}
@endif
{{ $comment->user->fullName() }} {{ $comment->created_at->diffForHumans() }}
@if(auth()->id() === $comment->user_id) @endif
{{ $comment->comment }}
@if(auth()->id() === $comment->user_id) @endif @endforeach
@csrf
@endsection @section('script') @endsection