@php $cover = $card->cover ?? ''; $hasCover = !empty($cover) && $cover !== '/storage/' && $cover !== 'storage/'; $coverStyle = $hasCover ? (str_starts_with($cover, 'http') || str_starts_with($cover, 'data:') ? 'background-image: url(' . e($cover) . ');' : 'background: ' . e($cover) . ';') : ''; // Better mapping of card labels using boardLabels $cardLabelsRaw = $card->labels ?? []; $cardLabels = []; if (is_array($cardLabelsRaw)) { foreach($cardLabelsRaw as $labelRef) { if (is_numeric($labelRef)) { $found = collect($boardLabels)->firstWhere('id', (int)$labelRef); if ($found) $cardLabels[] = $found; } elseif (is_array($labelRef)) { $cardLabels[] = (object)$labelRef; } else { $cardLabels[] = $labelRef; } } } $labelColorsMap = [ 'green' => '#61bd4f', 'yellow' => '#f2d600', 'orange' => '#ff9f1a', 'red' => '#eb5a46', 'purple' => '#c377e0', 'blue' => '#0079bf', ]; @endphp @if($hasCover) @php $isColor = preg_match('/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/', $cover); $coverUrl = $cover; if (!$isColor) { if (str_contains($cover, 'http') || str_contains($cover, 'data:')) { $coverUrl = $cover; } else { // If already /storage/... use directly, else treat as relative path $coverUrl = str_starts_with($cover, '/storage/') ? $cover : '/storage/' . ltrim($cover, '/'); } } @endphp @if($isColor)
@else
cover
@endif @else
@endif
{{ $list->name }}
{{ substr(auth()->user()->name, 0, 2) }}
Profile & Settings Log out

Description

{!! $card->description ?: 'Add a more detailed description...' !!}

Checklist

@php $total = $card->checklistItems->count(); $completed = $card->checklistItems->where('is_completed', true)->count(); $percent = $total > 0 ? round(($completed / $total) * 100) : 0; @endphp
{{ $percent }}%
@foreach($card->checklistItems as $item)
is_completed ? 'checked' : '' }} style="margin-top:3px;">
@endforeach
@if($card->attachments->count() > 0)

Attachments

@foreach($card->attachments as $attachment) @php $cleanPath = str_replace(['/storage/', 'storage/', 'http://127.0.0.1:8000/storage/', 'https://127.0.0.1/storage/'], '', $attachment->file_path ?? ''); $fileUrl = $cleanPath ? Storage::url($cleanPath) : ''; $isImage = !empty($attachment->name) && preg_match('/\.(jpg|jpeg|png|gif|webp|svg)$/i', $attachment->name); $extension = !empty($attachment->name) ? strtoupper(pathinfo($attachment->name, PATHINFO_EXTENSION)) : ''; @endphp
@if($isImage)
@else
{{ $extension ?: 'FILE' }}
@endif
{{ $attachment->name }}
Added {{ $attachment->created_at->diffForHumans() }}
@if(!$isImage) Download @endif Delete @if($isImage) {{ (str_contains($card->cover ?? '', $cleanPath)) ? 'Remove cover' : 'Make cover' }} @endif
@endforeach
@endif
@php $currentUserMember = $workspaceMembers->firstWhere('id', auth()->id()); $userPivot = $currentUserMember ? $currentUserMember->pivot : null; $hasCommentAccess = auth()->user()->isSystemAdmin() || $board->workspace->isOwner(auth()->id()) || $board->sharedUsers()->where('user_id', auth()->id())->exists(); @endphp

Activity

@if($hasCommentAccess)
{{ strtoupper(substr(auth()->user()->name, 0, 2)) }}
@else
You don't have permission to comment on this card.
@endif
{{-- Task 7.1: deleteChecklist() fix + Tasks 7.2-7.5: Echo real-time handlers --}}