@php $children = $projectMap->where('parent_id', $project->id)->values(); $typeColors = [ '開發' => ['bg' => '#138496', 'text' => '#fff'], '產品' => ['bg' => '#d97706', 'text' => '#fff'], '保固' => ['bg' => '#6f42c1', 'text' => '#fff'], '維護' => ['bg' => '#117a65', 'text' => '#fff'], '結束' => ['bg' => '#6c757d', 'text' => '#fff'], ]; $tc = $typeColors[$project->project_type] ?? ['bg' => '#6c757d', 'text' => '#fff']; $isRoot = $depth === 0; @endphp @if($depth === 0) @elseif($children->isNotEmpty()) @else @endif {{ $project->name }} @if($children->isNotEmpty()) {{ $children->count() }} @endif {{ $project->project_type }} {{ $project->dev_tool ?? '—' }} {{ $project->start_date ? \Carbon\Carbon::parse($project->start_date)->format('Y-m-d') : '—' }} {{ $project->end_date ? \Carbon\Carbon::parse($project->end_date)->format('Y-m-d') : '—' }} {{ $project->members->count() }} 進入 @if($depth < 5) @foreach($children->sortBy('name') as $child) @include('projects._project_row', ['project' => $child, 'depth' => $depth + 1, 'projectMap' => $projectMap]) @endforeach @endif