abanoubnassem / filament-phone-field
Provides a Phone Input field for the Filament Forms, works in Admin-Panel and Forntend-Forms
Installs: 29 720
Dependents: 0
Suggesters: 0
Security: 0
Stars: 18
Watchers: 2
Forks: 3
Open Issues: 5
Requires
- php: ^8.0|^8.1|^8.2|^8.3
- filament/forms: ^2.16|^3.0-stable|^3.2.51
- illuminate/contracts: ^9.0|^10.0|^11.0
- spatie/laravel-package-tools: ^1.13.0
This package is auto-updated.
Last update: 2024-12-18 07:44:36 UTC
README
A wrapper around intl-tel-input plugin for entering and validating international telephone numbers. It adds a flag dropdown to filament-forms, detects the user's country, displays a relevant placeholder and provides formatting/validation methods.
Installation
You can install the package via composer:
composer require abanoubnassem/filament-phone-field
You can publish the config file with:
php artisan vendor:publish --tag="filament-phone-field-config"
This is the Content of the published config file. Check it for more understanding of how the plugin works.
All the configurations , can be overridden by chaining the PhoneInput
field.
Usage
use AbanoubNassem\FilamentPhoneField\Forms\Components\PhoneInput; // admin panel public static function form(Form $form): Form { return $form->schema([ ... PhoneInput::make('phone') // make sure to set Initial Country to null, in the admin panel // especially if you have multiple records of phone numbers from // multiple different countries. ->initialCountry(null) ->tel() ]); } //frontend-forms protected function getFormSchema(): array { return [ .... PhoneInput::make('phone') ->tel() ]; }
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
If you discover any security related issues, please create an issue.
Credits
License
The MIT License (MIT). Please see License File for more information.