@php $styles = [ ['value' => 'btn-secondary', 'label' => 'Sage (solid)'], ['value' => 'btn-primary', 'label' => 'Outline'], ['value' => 'btn-dark-grey', 'label' => 'Dark grey'], ]; $alignments = [ ['value' => 'text-left', 'label' => 'Left'], ['value' => 'text-center', 'label' => 'Center'], ['value' => 'text-right', 'label' => 'Right'], ]; $targets = [ ['value' => '_self', 'label' => 'Same tab'], ['value' => '_blank', 'label' => 'New tab'], ]; $field = function ($name) use ($item) { return "components[{$item->id}][values][{$name}]"; }; $old = function ($name, $default = '') use ($item, $sub) { return old("components.{$item->id}.values.{$name}", $sub->$name ?? $default); }; @endphp