@php /** * Printable table-card sheet — a standalone document (no dashboard chrome), used two ways: * • the design editor preview iframe — ONE side, a sample scan URL, fitted to the frame; * • the print sheet — every table's FRONT then BACK, each on its own page, with the table's own QR. * Both render the exact same card through partials/qr-card-side.php, so the preview is true to paper. * * The QR is drawn client-side from each holder's scan PATH, made absolute with the live origin (so a * printed code works on any domain / sub-folder) — the existing scan-code logic is never touched here. * * @var array $pages [ ['side'=>.., 'product'=>..|null, 'qrPath'=>string], ... ] * @var array $card the whole card config (theme/accent/bgColor/orientation/poweredBy) * @var string $mode 'preview' | 'print' * @var string $title */ $mode = ($mode ?? 'print') === 'preview' ? 'preview' : 'print'; $card = $card ?? \App\Models\QrCard::defaultConfig(); $pages = $pages ?? []; $logo = $logo ?? []; $orient = ($card['orientation'] ?? 'portrait') === 'landscape' ? 'landscape' : 'portrait'; $paperCss = \App\Models\QrCard::PAPERS[$card['paper'] ?? 'a5']['css'] ?? 'A5'; $dir = is_rtl() ? 'rtl' : 'ltr'; @endphp {{ $title ?? 'QR cards' }} @if ($mode === 'print')
{{ t_raw('vendor.qr_card.back_to_codes') }}
@endif
@foreach ($pages as $p)
@partial('qr-card-side', [ 'side' => $p['side'] ?? [], 'card' => $card, 'product' => $p['product'] ?? null, 'qrPath' => (string) ($p['qrPath'] ?? ''), 'logo' => $logo, 'table' => $p['table'] ?? [], 'placeholder' => $mode === 'preview', ])
@endforeach
@if ($mode === 'preview') @endif