@if(isset($project)) @endif
{{ isset($project) ? $project->name . ' — Tasks' : 'My Tasks' }}
{{ isset($project) ? 'Manage and track tasks for this project' : 'All active tasks across your projects' }}
@php $todoCnt = count($tasks['to_do'] ?? []); $progressCnt = count($tasks['in_progress'] ?? []); $onHoldCnt = count($tasks['on_hold'] ?? []); $inReviewCnt = count($tasks['in_review'] ?? []); $completedCnt= count($tasks['completed'] ?? []); $totalCnt = $todoCnt + $progressCnt + $onHoldCnt + $inReviewCnt + $completedCnt; $hasAny = $totalCnt > 0; @endphp
{{ $totalCnt }} task{{ $totalCnt != 1 ? 's' : '' }}
@if(!$hasAny)
No tasks yet

{{ isset($project) ? 'Create the first task for ' . $project->name . '.' : 'No tasks found. Create one to get started.' }}

@else {{-- KANBAN --}}
To Do {{ $todoCnt }}
@forelse($tasks['to_do'] ?? [] as $task) @include('tasks._card', ['task' => $task]) @empty
No tasks here
@endforelse
In Progress {{ $progressCnt }}
@forelse($tasks['in_progress'] ?? [] as $task) @include('tasks._card', ['task' => $task]) @empty
Nothing active
@endforelse
On Hold {{ $onHoldCnt }}
@forelse($tasks['on_hold'] ?? [] as $task) @include('tasks._card', ['task' => $task]) @empty
None on hold
@endforelse
In Review {{ $inReviewCnt }}
@forelse($tasks['in_review'] ?? [] as $task) @include('tasks._card', ['task' => $task]) @empty
Nothing to review
@endforelse
Completed {{ $completedCnt }}
@forelse($tasks['completed'] ?? [] as $task) @include('tasks._card', ['task' => $task]) @empty
Nothing done yet
@endforelse
{{-- LIST VIEW --}}
Task
Project
Priority
Assignee
Due Date
@foreach(collect($tasks)->flatten() as $task)
{{ $task->title }}
{{ ucwords(str_replace('_',' ',$task->status)) }}
@if($task->project) {{ $task->project->name }} @else @endif
{{ ucfirst($task->priority) }}
@if($task->user)
{{ strtoupper(substr($task->user->name,0,1)) }}
{{ $task->user->name }}
@else Unassigned @endif
@if($task->due_date) {{ \Carbon\Carbon::parse($task->due_date)->format('M d, Y') }} @else @endif
@endforeach
@endif