@extends('adminlte.app') @section('content')

Anexar Documentos

@if ($message = Session::get('success'))

{{ $message }}

@endif @if ($message = Session::get('error'))

{{ $message }}

@endif
Anexar Documentos
@csrf
@if(!empty($anexos)) @foreach($anexos as $index => $anexo)
@php $extensao = strtolower(pathinfo($anexo->anexo, PATHINFO_EXTENSION)); $url = route('anexo.download', ['file' => basename($anexo->anexo), 'view' => true, 'folha_id' => $folhaId]); @endphp {{-- Se for imagem --}} @if(in_array($extensao, ['jpg','jpeg','png','gif','bmp','webp']))
Anexo {{ $index + 1 }} {{-- Se for PDF --}} @elseif($extensao === 'pdf' or $extensao === 'utf-8') {{-- Caso contrário, mostra só botão para abrir --}} @else Visualizar @endif
Selecione a Folha de Caixa que deseja anexar o arquivo:
@foreach($folhasCaixa as $folha) @endforeach
Selecionar ID Folha de Caixa Posto Turno Data de Criação Observação
id == $folhaId) checked @endif name="folha_caixa_selecionada_{{ $index }}[]" value="{{ $folha->id }}"> {{ $folha->id }} {{ $folha->posto->nome_posto }} {{ $folha->turno }} {{ $folha->created_at->format('d/m/Y H:i') }}
@endforeach @else

Nenhum anexo disponível.

@endif
@endsection