Skip to content

Commit 2456c25

Browse files
jcastroa87tabacitupxpm
authored
Phone field documentation (#388)
* Phone field documentation * Update docs * Update 5.x/crud-fields.md Co-authored-by: Cristian Tăbăcitu <[email protected]> * Update 5.x/crud-fields.md Co-authored-by: Cristian Tăbăcitu <[email protected]> * Update 5.x/crud-fields.md Co-authored-by: Cristian Tăbăcitu <[email protected]> * Update 5.x/crud-fields.md Co-authored-by: Pedro Martins <[email protected]> * Update 5.x/crud-fields.md Co-authored-by: Cristian Tăbăcitu <[email protected]> Co-authored-by: Pedro Martins <[email protected]>
1 parent 40cc8fb commit 2456c25

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

5.x/crud-fields.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,6 +1635,40 @@ Input preview:
16351635
16361636
> NOTE: if you are having trouble uploading big images, please check your php extensions **apcu** and/or **opcache**, users have reported some issues with these extensions when trying to upload very big images. REFS: https://github.com/Laravel-Backpack/CRUD/issues/3457
16371637
1638+
<hr>
1639+
1640+
<a name="phone"></a>
1641+
### phone <span class="badge badge-pill badge-info">PRO</span>
1642+
1643+
Show a telephone number input. Lets the user choose the prefix using a flag from dropdown.
1644+
1645+
```php
1646+
[ // phone
1647+
'name' => 'phone', // db column for phone
1648+
'label' => 'Phone',
1649+
'type' => 'phone',
1650+
1651+
// OPTIONALS
1652+
// most options provided by intlTelInput.js are supported, you can try them out using the `config` attribute;
1653+
// take note that options defined in `config` will override any default values from the field;
1654+
'config' => [
1655+
'onlyCountries' => ['pt', 'ro'],
1656+
'initialCountry' => 'cl',
1657+
'separateDialCode' => true,
1658+
'nationalMode' => true,
1659+
'autoHideDialCode' => false,
1660+
'placeholderNumberType' => 'MOBILE',
1661+
]
1662+
],
1663+
```
1664+
1665+
For more info about parameters please see this JS plugin's [official documentation](https://github.com/jackocnr/intl-tel-input).
1666+
1667+
Your end result will look like this:
1668+
1669+
![CRUD Field - phone](https://user-images.githubusercontent.com/1032474/204588174-48935030-54e6-4a30-b34c-7e94220ae242.png)
1670+
1671+
> NOTE: you can validate this using Laravel's default **numeric** or if you want something advanced, we recommend [Laravel Phone](https://github.com/Propaganistas/Laravel-Phone)
16381672
16391673
<hr>
16401674

0 commit comments

Comments
 (0)