@props([ 'tasks' => [], 'users' => [], 'className' => '' ]) @php $columns = [ [ 'id' => 'todo', 'title' => 'To Do', 'color' => 'bg-body border-light shadow-sm', 'tasks' => $tasks['todo'] ?? [] ], [ 'id' => 'inprogress', 'title' => 'In Progress', 'color' => 'bg-body border-primary shadow-sm', 'tasks' => $tasks['inprogress'] ?? [] ], [ 'id' => 'review', 'title' => 'Review', 'color' => 'bg-body border-warning shadow-sm', 'tasks' => $tasks['review'] ?? [] ], [ 'id' => 'done', 'title' => 'Done', 'color' => 'bg-body border-success shadow-sm', 'tasks' => $tasks['done'] ?? [] ] ]; $priorityColors = [ 'low' => 'bg-success text-white', 'medium' => 'bg-warning text-dark', 'high' => 'bg-danger text-white', 'urgent' => 'bg-dark text-white' ]; $priorityIcons = [ 'low' => 'bx-flag', 'medium' => 'bx-flag', 'high' => 'bx-flag', 'urgent' => 'bx-flag' ]; @endphp
@foreach($columns as $column)
{{ $column['title'] }} {{ count($column['tasks']) }}
@forelse($column['tasks'] as $task)
{{ $task['title'] ?? 'Task Title' }}
@if(isset($task['dueDate']))
{{ \Carbon\Carbon::parse($task['dueDate'])->format('M d') }}
@endif
@if(isset($task['assignee']))
@if(isset($task['assignee']['avatar'])) {{ $task['assignee']['name'] }} @else
{{ collect(explode(' ', $task['assignee']['name']))->map(fn($n) => $n[0])->join('') }}
@endif
@endif
@empty

No tasks in this column

@endforelse
@endforeach