Teste de Anexos

@foreach(\App\Models\Contrato::whereNotNull('anexo_contrato')->take(5)->get() as $contrato)

Contrato #{{ $contrato->id }}

Arquivo: {{ $contrato->anexo_contrato }}

Visualizar Anexo | Download Anexo

@php $filePath = storage_path('app/public/anexos_contratos/' . $contrato->anexo_contrato); $existe = file_exists($filePath); @endphp

Arquivo existe fisicamente: {{ $existe ? 'SIM' : 'NÃO' }}

@if($existe)

Tamanho: {{ filesize($filePath) }} bytes

@endif
@endforeach