@php $qid = $q->id; $type = strtolower($q->input_type ?? 'text'); $label = $q->label ?: 'Question'; $req = (bool) $q->is_required; $maxlen = $q->total_digits ? (int) $q->total_digits : null; @endphp