PHPackages                             xini/silverstripe-international-phone-number-field - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. xini/silverstripe-international-phone-number-field

Abandoned → [innoweb/silverstripe-international-phone-number-field](/?search=innoweb%2Fsilverstripe-international-phone-number-field)Silverstripe-vendormodule[Database &amp; ORM](/categories/database)

xini/silverstripe-international-phone-number-field
==================================================

Adds a phone filed using Google's libphonenumber.

6.0.2(7mo ago)5996[1 issues](https://github.com/xini/silverstripe-international-phone-number-field/issues)BSD-3-ClausePHPCI passing

Since Jan 30Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/xini/silverstripe-international-phone-number-field)[ Packagist](https://packagist.org/packages/xini/silverstripe-international-phone-number-field)[ RSS](/packages/xini-silverstripe-international-phone-number-field/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (42)Used By (0)

International Phone Number Field
================================

[](#international-phone-number-field)

[![Version](https://camo.githubusercontent.com/38cc982422b00a9cb8bc4145d0014a883da94f85881490974904c6728c435bd9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e6e6f7765622f73696c7665727374726970652d696e7465726e6174696f6e616c2d70686f6e652d6e756d6265722d6669656c642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/innoweb/silverstripe-international-phone-number-field)[![License](https://camo.githubusercontent.com/4affc2951a78facd4e277c59ee0bed4d9939f3093384b17a2e9038b6d373d6b4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f696e6e6f7765622f73696c7665727374726970652d696e7465726e6174696f6e616c2d70686f6e652d6e756d6265722d6669656c642e7376673f7374796c653d666c61742d737175617265)](license.md)

Introduction
------------

[](#introduction)

Adds a database and form field for international phone numbers using [Google's libphonenumber](https://github.com/googlei18n/libphonenumber) and the [intl-tel-input plugin](https://github.com/jackocnr/intl-tel-input).

IP Geo Location services supported:

- [ipstack.com](https://ipstack.com)
- [ipinfo.io](https://ipinfo.io)
- [ipgeolocation](https://ipgeolocation.io/)
- [ipapi](https://ipapi.co/)

Requirements
------------

[](#requirements)

- Silverstripe ^6
- [libphonenumber port for PHP ^9](https://github.com/giggsey/libphonenumber-for-php)

Note: this version is compatible with SilverStripe 6. For SilverStripe 5, please see the [5 release line](https://github.com/xini/silverstripe-international-phone-number-field/tree/5).

Installation
------------

[](#installation)

Install the module using composer:

```
composer require innoweb/silverstripe-international-phone-number-field dev-master

```

Then run dev/build.

Usage
-----

[](#usage)

### Database field

[](#database-field)

This module provides a database field to be used for data objects:

```
private static $db = [
	...
	'PhoneNumber' => 'Phone',
	...
];

```

This stores the phone number in the database as a varchar.

In the CMS the data type `Phone` renders as a `InternationalPhoneNumberField`.

In templates, the following formatting functions are available:

- `$PhoneNumber.International`: Returns the phone number in international format, e.g. "+41 44 668 1800"
- `$PhoneNumber.National`: Returns the phone number in national format, e.g. "044 668 1800"
- `$PhoneNumber.E164`: Returns the phone number in international format, but with no formatting applied, e.g. "+41446681800"
- `$PhoneNumber.URL` or `$PhoneNumber.RFC3966`: Returns the phone number in international format, but with all spaces and other separating symbols replaced with a hyphen, and with any phone number extension appended with ";ext=". It also will have a prefix of "tel:" added, e.g. "tel:+41-44-668-1800".

### Form field

[](#form-field)

The `InternationalPhoneNumberField` can be used for any Varchar field storing a phone number.

Configuration
-------------

[](#configuration)

To set the field to use the user's current location as default and customise the field, you can configure the following options for the `InternationalPhoneNumberField` class:

- `geolocation_service`: Uses IP location to determine the current users's country code. This can be `'ipstack'`, `'ipinfo'`, `'ipgeolocation'`, `'ipapi'` or `false`. Defaults to `false`.
- `geolocation_api_key`: API key for [ipstack.com](https://ipstack.com), [ipinfo.io](https://ipinfo.io) or [ipgeolocation](https://ipgeolocation.io/). Defaults to `false`.
- `geolocation_protocol`: Protocol to be used to connecto to geolocation service. Defaults to `'https'`.
- `initial_country`: Country code for initially shown country in the phone number field. Defaults to `'auto'`, in which case the location is determined using geolocation if that's set up.
- `load_default_from_user_agent`: Enable loading the default country from the user agent's timezone settings instead of a geo ip service. This is only used if `geolocation_service` is `false` and `initial_country` is `auto`. Defaults to `true`.
- `only_countries`: Array of country codes available for selection. Defaults to `false`, all countries are listed.
- `preferred_countries`: Array of country codes pushed to the top of the dropdown list. Defaults to `false`, all countries are listed alphabetically.
- `excluded_countries`: Array of country codes to be excluded from the dropdown lost. Defaults to `false`, all countries are listed.

License
-------

[](#license)

BSD 3-Clause License, see [License](license.md)

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance61

Regular maintenance activity

Popularity17

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 80.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~88 days

Recently: every ~10 days

Total

41

Last Release

233d ago

Major Versions

1.1.0 → 2.0.02017-04-24

2.0.x-dev → 3.0.02018-12-17

3.0.x-dev → 4.0.02021-05-06

4.x-dev → 5.0.02023-03-15

5.x-dev → 6.0.02025-09-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d2e71d7787401a7bd4916062346163897f89f455d650ab32b5d60cd14825ad3?d=identicon)[xini](/maintainers/xini)

---

Top Contributors

[![xini](https://avatars.githubusercontent.com/u/1152403?v=4)](https://github.com/xini "xini (58 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![dizzystuff](https://avatars.githubusercontent.com/u/576903?v=4)](https://github.com/dizzystuff "dizzystuff (3 commits)")[![wernerkrauss](https://avatars.githubusercontent.com/u/1043925?v=4)](https://github.com/wernerkrauss "wernerkrauss (2 commits)")[![jinjie](https://avatars.githubusercontent.com/u/2721195?v=4)](https://github.com/jinjie "jinjie (1 commits)")[![muskie9](https://avatars.githubusercontent.com/u/870751?v=4)](https://github.com/muskie9 "muskie9 (1 commits)")

---

Tags

databasesilverstripephoneformfieldinternationalgeo-location

### Embed Badge

![Health badge](/badges/xini-silverstripe-international-phone-number-field/health.svg)

```
[![Health](https://phpackages.com/badges/xini-silverstripe-international-phone-number-field/health.svg)](https://phpackages.com/packages/xini-silverstripe-international-phone-number-field)
```

###  Alternatives

[silverstripe/postgresql

SilverStripe now has tentative support for PostgreSQL ('Postgres')

16258.1k2](/packages/silverstripe-postgresql)[silverstripe/mssql

Adds MSSQL support to SilverStripe

157.8k1](/packages/silverstripe-mssql)[brettt89/silverstripe-garbage-collector

SilverStripe Garbage Collector module

109.6k](/packages/brettt89-silverstripe-garbage-collector)[burnbright/silverstripe-externalurlfield

Provides SilverStripe with a DBField and FormField for handling external URLs.

109.6k1](/packages/burnbright-silverstripe-externalurlfield)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
