bocanhcam / nova-phone
A custom Laravel Nova field to handle phone numbers.
Installs: 216
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Vue
Requires
- php: ^7.3|^8.0
- laravel/nova: ^4.0
README
A custom Laravel Nova field to handle phone numbers. This field automatically formats phone numbers as the user types, supports country-based formatting, and allows international formatting.
Installation
Install the package via Composer:
composer require bocanhcam/nova-phone
Usage
Usage
Add the phone field to your Nova resource:
\Bocanhcam\NovaPhone\Phone::make(__('Phone'), 'phone')
Specify the country and display format
By default, the field uses the US as the country and national formatting.
Override the default format like below.
\Bocanhcam\NovaPhone\Phone::make(__('Phone'), 'phone') ->country('JP') // Format for Japan ->international() // Display as international number
Powered by libphonenumber-js
For more details on libphonenumber-js, check out their documentation.
License
This package is open-sourced software licensed under the MIT license.