@php if (empty($inputId)) { $inputId = $model ?? 'phone'; $inputId .= rand(1000, 99999); } $modelId = $model ?? 'phone'; $defaultCountry = setting('countryCode', 'GH'); //explode default country code and select the last part $defaultCountry = explode(',', $defaultCountry); $defaultCountry = end($defaultCountry) ?? 'US'; $phoneInitData = [$inputId, $modelId, $value ?? '', $defaultCountry]; @endphp