@props([ 'name', 'label', 'options' => [], 'optional' => false, 'errorName' => $name, 'withError' => null, 'placeholder' => 'Please specify...', '$hide_empty_option' => false, ]) @php // Try and get old value from old() $old_value = old($name); // No value found yet if ($old_value === NULL) { // Try and get value from $current_data if(isset($current_data) && array_key_exists($name, $current_data)) { $old_value = $current_data[$name]; } } // Numeric value found if (is_numeric($old_value)) { // Convert to integer for strict matching $old_value = (int) $old_value; } @endphp