@extends('layouts.admin') @section('title', 'View Badge') @section('content')

Badge Details

Selected Fields:
    @php $raw = $badge->selected_fields ?? []; if ($raw instanceof \Illuminate\Support\Collection) { $fields = $raw->all(); } elseif (is_array($raw)) { $fields = $raw; } elseif (is_string($raw)) { // Try JSON first $decoded = json_decode($raw, true); if (json_last_error() === JSON_ERROR_NONE && is_array($decoded)) { $fields = $decoded; } else { // Fallback: comma-separated or bracketed string $clean = trim($raw, "[] \t\n\r\0\x0B\"'"); $fields = $clean === '' ? [] : array_filter(array_map( fn ($v) => trim($v, " \t\n\r\0\x0B\"'"), explode(',', $clean) )); } } else { $fields = []; } @endphp @if(!empty($fields)) @foreach($fields as $field)
  • {{ ucwords(str_replace('_', ' ', $field)) }}
  • @endforeach @endif
  • {{ $badge->width }}*{{ $badge->height }} (in CM)
@php $width_mm = isset($badge['width']) ? $badge['width'] * 25.4 : 85.6; $height_mm = isset($badge['height']) ? $badge['height'] * 25.4 : 54; @endphp
@if($badge->logo_path == 1) @endif
@if($badge->name == 1)

{{'name'}}

@endif @if($badge->company_name == 1)

{{'company_name'}}

@endif @if($badge->designation == 1)

{{'designation'}}

@endif
@if($badge->qr_code_data == 1) QR Code @endif
Actions
{{-- Print Badge --}} Create New Badge @if($badge->qr_code_path) View QR Code @endif
@endsection @section('scripts') @endsection