@php /** @var \Illuminate\Support\Collection $labels */ /** @var string $garageName */ /** @var string $labelSize */ /** @var array $labelPreset */ /** @var array $eplLayout */ /** @var string $generatedEpl */ /** @var bool $rotate */ /** @var string $roll */ /** @var string $barDir */ /** @var int $barNarrow */ /** @var float $gapMm */ /** @var float $offsetXmm */ /** @var float $offsetYmm */ /** @var float $pitchMm */ $w = (float) ($labelPreset['w_mm'] ?? 38.0); $h = (float) ($labelPreset['h_mm'] ?? 28.0); $usesWs8240Epl = ! empty($labelPreset['epl_ws8240']); $eplLayout = $eplLayout ?? []; $wDots = (int) ($eplLayout['q'] ?? 304); $hDots = (int) ($eplLayout['label_len'] ?? 224); $gapDots = (int) ($eplLayout['gap'] ?? 24); $eplTextX = (int) ($eplLayout['text_x'] ?? 20); $eplTextY = (int) ($eplLayout['text_y'] ?? 20); $eplBarX = (int) ($eplLayout['bar_x'] ?? 20); $eplBarY = (int) ($eplLayout['bar_y'] ?? 60); $eplBarH = (int) ($eplLayout['bar_h'] ?? 80); $eplBarNarrow = (int) ($eplLayout['bar_narrow'] ?? 2); $rotate = (bool) ($rotate ?? false); $roll = (string) ($roll ?? ($usesWs8240Epl ? 'vertical' : ($rotate ? 'vertical' : 'horizontal'))); if (! in_array($roll, ['horizontal', 'vertical'], true)) { $roll = $usesWs8240Epl ? 'vertical' : 'horizontal'; } $barDir = (string) ($barDir ?? 'horizontal'); if ($usesWs8240Epl || $w < 45) { $barDir = 'horizontal'; } elseif (! in_array($barDir, ['horizontal', 'vertical'], true)) { $barDir = 'horizontal'; } $barNarrow = (int) ($barNarrow ?? 2); $barNarrow = max(1, min(4, $barNarrow)); $gapMm = (float) ($gapMm ?? 3.0); $pitchMm = (float) ($pitchMm ?? $h); $offsetXmm = (float) ($offsetXmm ?? 0.0); $offsetYmm = (float) ($offsetYmm ?? 0.0); // WS8240 / 40×25: EPL always rotation 0 — preview matches physical label, no CSS rotate. $isHorizRoll = $roll === 'horizontal'; $pageW = $w; $pageH = $h; $cssRotateLabel = $usesWs8240Epl ? false : ! $isHorizRoll; $cssRotateBarcode = $usesWs8240Epl ? false : ($barDir === 'vertical' && $isHorizRoll); $fmt = function ($v) { return rtrim(rtrim(number_format($v, 3, '.', ''), '0'), '.'); }; $wCss = $fmt($w); $hCss = $fmt($h); $pageWCss = $fmt($pageW); $pageHCss = $fmt($pageH); $isSmall = ($w < 45) || ($h < 24); $isTiny = ($w < 35) || ($h < 22); $padV = $isTiny ? 0.8 : ($isSmall ? 1.0 : 1.2); $padH = $isTiny ? 0.8 : ($isSmall ? 1.0 : 1.2); $garageReserve = $isTiny ? 2.6 : ($isSmall ? 3.0 : 3.4); $codeReserve = $isTiny ? 2.2 : ($isSmall ? 2.6 : 3.0); $gapReserve = $isTiny ? 0.3 : 0.4; $barAreaH = max(7.0, $h - (2 * $padV) - $garageReserve - $codeReserve - $gapReserve); $barAreaHCss = $fmt($barAreaH); $padVCss = $fmt($padV); $padHCss = $fmt($padH); $gapCss = $fmt($gapMm); $pitchCss = $fmt($pitchMm); $offXCss = $fmt($offsetXmm); $offYCss = $fmt($offsetYmm); @endphp Print barcodes · {{ $garageName }}

Barcode labels

{{ $garageName }} · {{ $labels->count() }} {{ $labels->count() === 1 ? 'label' : 'labels' }}

Preview

{{ $labelPreset['title'] ?? '' }} — first label at actual size

Label preview @php $first = $labels->first(); @endphp @if($first)
{{ e($garageName) }}
@if($first['barcode_svg'] !== '')
{!! $first['barcode_svg'] !!}
{{ e($first['barcode_value']) }}
@else
No barcode code on file
Inv: {{ $first['inventory_code'] ?: '—' }}
@endif
@endif @if($labels->count() > 1)

{{ $labels->count() - 1 }} more in this batch — listed below. All use the same layout.

@else

This is what will print on each label.

@endif
@if($labels->count() > 1)
@foreach($labels as $L)
{{ e($L['barcode_value'] ?: '—') }} {{ e(\Illuminate\Support\Str::limit($L['name'], 48)) }}
@endforeach
@endif
@foreach($labels as $L)
{{ e($garageName) }}
@if($L['barcode_svg'] !== '')
{!! $L['barcode_svg'] !!}
{{ e($L['barcode_value']) }}
@else
No barcode (code) on file
Inv: {{ $L['inventory_code'] ?: '—' }} · {{ e(\Illuminate\Support\Str::limit($L['name'], 36)) }}
@endif
@endforeach