@php $attachments = $brief->attachments ?? collect(); $grouped = $attachments->groupBy(fn ($a) => $a->folderName() ?? '__root__'); $canUpload = auth()->user()->hasRole('admin') || auth()->user()->employer; @endphp

Fichiers & dossiers

Maquettes et assets partages

@if($attachments->isNotEmpty()) Tout telecharger (.zip) @endif
@if($canUpload)
@csrf
@endif
@if($attachments->isEmpty())

Aucun fichier pour ce brief.

@else
@foreach($grouped as $folderKey => $folderFiles)
@if($folderKey !== '__root__')
{{ $folderKey }} ({{ $folderFiles->count() }})
@endif
    @foreach($folderFiles as $attachment) @php $previewUrl = route('employer-briefs.attachments.show', ['brief' => $brief, 'attachment' => $attachment]); $downloadUrl = $previewUrl.'?download=1'; $canDelete = auth()->user()->hasRole('admin') || (auth()->user()->employer && (int) $attachment->employer_id === (int) auth()->user()->employer->id); @endphp
  • @if($attachment->isImage()) @else
    {{ $attachment->extension() ?: '?' }}
    @endif

    {{ $folderKey === '__root__' ? $attachment->original_name : basename($attachment->relative_path ?? $attachment->original_name) }}

    {{ $attachment->formattedSize() }} @if($attachment->employer?->user) · {{ $attachment->employer->user->name }} @endif · {{ $attachment->created_at?->format('d/m/Y H:i') }}

    @if($attachment->isPreviewable()) @endif Telecharger @if($canDelete)
    @csrf @method('DELETE')
    @endif
  • @endforeach
@endforeach
@endif