@extends('layouts.app') @section('title', '專案管理') @push('styles') @endpush @section('content') @php $activeCount = $projects->where('is_ended', false)->count(); $endedCount = $projects->where('is_ended', true)->count(); $clientCounts = $projects->groupBy(fn($p) => $p->client_id ?? 0) ->map->count(); @endphp
{{-- ===== 左側客戶清單 ===== --}}
客戶
{{-- ====================== 到期提醒區塊 ====================== --}} @if ($soonToExpire->count())
⏰ 即將到期專案提醒 (點擊可收合)
    @foreach ($soonToExpire->sortBy(function ($exp) { return \Carbon\Carbon::parse($exp->end_date)->timestamp; }) as $exp) @php $end = \Carbon\Carbon::parse($exp->end_date); $now = \Carbon\Carbon::now(); $daysLeft = $now->floatDiffInRealDays($end, false); @endphp @if ($daysLeft > 0)
  • {{ $exp->name }} (客戶:{{ $exp->client?->name ?? '未分類' }}) 結束日:{{ $end->format('Y-m-d') }} (剩 {{ number_format($daysLeft, 1) }} 天) 編輯
  • @endif @endforeach
@endif

專案管理

{{-- 批次操作 toolbar --}} @can('create', App\Models\Project::class)
@csrf
已選 0 個專案
@endcan {{-- 篩選列 --}}
{{-- col 0: id for sort --}} @can('create', App\Models\Project::class) @endcan @foreach ($projects as $p) @php $catClass = $p->project_category === '產品' ? 'cat-product' : 'cat-project'; $typeClass = 'type-' . ($p->project_type ?? '其他'); @endphp {{-- sort col --}} @can('create', App\Models\Project::class) @endcan @endforeach
分類 / 階段 客戶名稱 專案名稱 開發框架 起始日 結束日 操作
{{ $p->id }} {{ $p->project_category ?? '未分類' }} {{ $p->project_type ?? '其他' }} {{ $p->client?->name ?? '未分類' }} {{ $p->name }} @if($p->dev_tool) {{ $p->dev_tool }} @else @endif {{ $p->start_date ? \Carbon\Carbon::parse($p->start_date)->format('Y-m-d') : '—' }} {{ $p->end_date ? \Carbon\Carbon::parse($p->end_date)->format('Y-m-d') : '—' }} 進入 編輯
@csrf @method('DELETE')
{{-- flex-grow-1 --}}
{{-- d-flex --}} @endsection @push('scripts') @endpush