@extends('boletos.layout') @section('title', 'Boleto - ' . ($consolidatedBoleto->code ?? 'Boleto')) @section('content') @php // Suporta tanto um único boleto quanto uma collection ($boletos) $items = isset($boletos) ? $boletos : collect(isset($consolidatedBoleto) ? [$consolidatedBoleto] : []); // Mapa de logos por integration_type — adicione novos bancos aqui $logoMap = [ 'SICREDI' => 'assets/images/boleto/sicredi.jpg', 'SICOOB' => 'assets/images/boleto/sicoob.jpg', 'BRADESCO' => 'assets/images/boleto/bradesco.jpg', 'CAIXA_ECONOMICA' => 'assets/images/boleto/caixa.jpg', ]; @endphp @foreach($items as $boleto) @php $boletoOwner = $boleto->owner ?? optional($boleto->unit)->owner ?? null; $bank = $boleto->bank ?? null; $bankType = strtoupper($bank?->integration_type ?? ''); // Usa logo do banco se arquivo existir; header-banco.blade.php trata fallback de texto $logoPath = (isset($logoMap[$bankType]) && file_exists(public_path($logoMap[$bankType]))) ? $logoMap[$bankType] : null; @endphp