PHP code example of cheesegrits / filament-phone-numbers
1. Go to this page and download the library: Download cheesegrits/filament-phone-numbers 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/ */
cheesegrits / filament-phone-numbers example snippets
use Cheesegrits\FilamentPhoneNumbers;
FilamentPhoneNumbers\Forms\Components\PhoneNumber::make('phone')
use Cheesegrits\FilamentPhoneNumbers;
FilamentPhoneNumbers\Forms\Components\PhoneNumber::make('phone')
->displayFormat(FilamentPhoneNumbers\Enums\PhoneFormat::INTERNATIONAL)
->databaseFormat(FilamentPhoneNumbers\Enums\PhoneFormat::INTERNATIONAL)
use Cheesegrits\FilamentPhoneNumbers;
FilamentPhoneNumbers\Forms\Components\PhoneNumber::make('phone')
->strict()
use Cheesegrits\FilamentPhoneNumbers;
FilamentPhoneNumbers\Forms\Components\PhoneNumber::make('phone')
->region('GB')
use Cheesegrits\FilamentPhoneNumbers;
FilamentPhoneNumbers\Forms\Components\PhoneNumber::make('phone')
->mask('99 99-99-99-99')
use Cheesegrits\FilamentPhoneNumbers;
FilamentPhoneNumbers\Columns\PhoneNumberColumn::make('phone'),
use Cheesegrits\FilamentPhoneNumbers;
FilamentPhoneNumbers\Columns\PhoneNumberColumn::make('phone')
->displayFormat(FilamentPhoneNumbers\Enums\PhoneFormat::NATIONAL)
->region('CA')
->dial(),
use Cheesegrits\FilamentPhoneNumbers;
use Illuminate\Database\Query\Builder;
// uses modified search query described above
FilamentPhoneNumbers\Columns\PhoneNumberColumn::make('phone')
->searchable(),
// bypasses query modification to use standard Filament query
FilamentPhoneNumbers\Columns\PhoneNumberColumn::make('phone')
->useDefaultSearch()
->searchable(),
// uses your own query, bypassing custom query
FilamentPhoneNumbers\Columns\PhoneNumberColumn::make('phone')
->searchable(query: function (Builder $query, string $search) {
// your query here
}),
use Cheesegrits\FilamentPhoneNumbers;
FilamentPhoneNumbers\Infolists\Components\PhoneNumberEntry::make('phone'),
use Cheesegrits\FilamentPhoneNumbers;
FilamentPhoneNumbers\Infolists\Components\PhoneNumberEntry::make('phone')
->displayFormat(FilamentPhoneNumbers\Enums\PhoneFormat::INTERNATIONAL)
->region('GB')
->dial(),