@foreach ($tarjetas as $tarjeta)
{{-- Logo del comercio --}} @php $logo_path = storage_path('app/public/' . $tarjeta->logo); $logo_base64 = ''; $logo_mime = ''; if (file_exists($logo_path)) { $logo_base64 = base64_encode(file_get_contents($logo_path)); $logo_mime = mime_content_type($logo_path); } @endphp @if($logo_base64) @endif {{-- Información --}}
{{ $tarjeta->nombre_comercio }}
Puntos: {{ $tarjeta->puntos }}
Categoría: {{ ucfirst($tarjeta->categoria ?? 'N/A') }}
ID: #{{ $tarjeta->id }}
{{-- Código QR embebido en base64 (formato SVG) --}} @php $qr_svg = \SimpleSoftwareIO\QrCode\Facades\QrCode::format('svg')-> size(100)->generate(route('tarjetas.sumar.token', ['uuid' => $tarjeta->uuid])); $qr_base64 = base64_encode($qr_svg); @endphp
QR Code
@endforeach