PHP code example of erlenwald / filament-phone-input
1. Go to this page and download the library: Download erlenwald/filament-phone-input library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
erlenwald / filament-phone-input example snippets
use Erlenwald\FilamentPhoneInput\PhoneInput;
PhoneInput::make('phone');
[
'phone' => '+[country_code][national_number]',
]
PhoneInput::make('phone')
->countryStatePath();
[
'phone' => '+[country_code][national_number]',
'phone_country' => 'RU',
]
use Erlenwald\FilamentPhoneInput\Enums\PhoneNumberFormat;
use Erlenwald\FilamentPhoneInput\PhoneInput;
PhoneInput::make('phone')
->countryStatePath('phone_country')
->defaultCountry('RU')
->countries(['RU', 'BY', 'KZ'])
->favoriteCountries(['RU', 'BY'])
->displayCountryFlag()
->flagAspect('4x3')
->phoneNumberFormat(PhoneNumberFormat::E164);
use Erlenwald\FilamentPhoneInput\Enums\PhoneNumberFormat;
PhoneInput::make('phone')
->phoneNumberFormat(PhoneNumberFormat::E164);
PhoneInput::make('phone')
->phoneNumberFormat('international');
PhoneInput::make('phone');
[
'phone' => '+[country_code][national_number]',
]
PhoneInput::make('phone')
->countryStatePath();
[
'phone' => '+[country_code][national_number]',
'phone_country' => 'RU',
]
PhoneInput::make('phone')
->countryStatePath('country');
[
'phone' => '+[country_code][national_number]',
'country' => 'RU',
]
PhoneInput::make('contact_phone_input')
->phoneStatePath('phone')
->countryStatePath('phone_country');
[
'phone' => '+[country_code][national_number]',
'phone_country' => 'RU',
]
PhoneInput::make('phone')
->countries(['RU', 'BY', 'KZ']);
PhoneInput::make('phone')
->favoriteCountries(['RU', 'BY']);
PhoneInput::make('phone')
->defaultCountry('RU');
PhoneInput::make('phone')
->displayCountryFlag();
PhoneInput::make('phone')
->displayCountryFlag()
->flagAspect('4x3');
PhoneInput::make('phone')
->displayCountryFlag()
->flagAspect('1x1');
PhoneInput::make('phone')
->defaultCountry('RU')
->ipLookup('/ip-country', 'country_code');
PhoneInput::make('phone')
->ipLookup('/ip-country', 'location.country_code');
PhoneInput::make('phone')
->bash
php artisan vendor:publish --tag=filament-phone-input-assets
bash
php artisan filament:assets
bash
php artisan optimize:clear
bash
php artisan filament:assets
php artisan optimize:clear
bash
php artisan vendor:publish --tag=filament-phone-input-assets
bash
php artisan vendor:publish --tag=filament-phone-input-styles
bash
php artisan filament:assets
php artisan optimize:clear
bash
php artisan vendor:publish --tag=filament-phone-input-translations
text
lang/vendor/erlenwald-filament-phone-input/en/phone-input.php
lang/vendor/erlenwald-filament-phone-input/ru/phone-input.php
bash
php artisan vendor:publish --tag=filament-phone-input-styles
bash
php artisan filament:assets
php artisan optimize:clear
bash
php artisan filament:assets
bash
php artisan vendor:publish --tag=filament-phone-input-assets --force
php artisan filament:assets
php artisan optimize:clear