# SiberfxIntlTelInput


More exactly, it adds the [intl-tel-input](https://intl-tel-input.com/) plugin to your Siberfx CRUD interfaces as a field, you can easily input valid international phone numbers.


## Screenshots

![Siberfx Intl Tel Input Addon](https://user-images.githubusercontent.com/1624261/144711736-7491f056-ba6d-4ca1-b78b-0aa6504fb6fb.png)


## Usage

To use the field this package provides, inside your custom CrudController do:

```php
$this->crud->addField([   // phone
    'name'  => 'phone', // db column for phone
    'label' => 'Phone',
    'type'  => 'phone',

    // OPTIONALS
    // most options provided by intlTelInput.js are supported, you can try them out using the `config` attribute;
    //  take note that options defined in `config` will override any default values from the field;
    'config' => [
        'onlyCountries' => ['tr', 'us', 'de', 'ru', 'bg', 'by'],
        'initialCountry' => 'tr', // this needs to be in the allowed country list, either in `onlyCountries` or NOT in `excludeCountries`
        'separateDialCode' => true,
        'nationalMode' => true,
        'autoHideDialCode' => false,
        'placeholderNumberType' => 'MOBILE',
    ]
]);
```
