Warp Input demo — phone numbers, addresses, money, IDs, signatures and form helpers for Filament. Change or delete anything; the data is reset every hour. warpui.com About Warp Input Docs Ask a question Support
Skip to content

IDs and numbers

IdInput replaces TextInput for tax numbers, bank accounts, barcodes and postal codes. Choose the kind of number with ->type(IdType::...): the field tidies the number while you type, explains what is wrong under the field, and saves every number in one shape, so de 123 456 789 and DE123456789 are the same text. SequenceInput gives each new record the next number.

Bank account numbers (IBAN)

->type(IdType::Iban) checks the length for each of 88 countries and the check digits, shows the IBAN in groups of four and saves it without spaces.

Note: Try it

Type de89 3704 0044 0532 0130 00: it becomes DE89 3704 0044 0532 0130 00. Press “Show what would be saved”: "DE89370400440532013000". Then change the last 00 to 01 and click outside the field: “This IBAN doesn’t add up. One of the characters is probably mistyped.”

Only some countries

->onlyCountries(['DE', 'FR', 'NL']) accepts IBANs from those countries only. It works for EU VAT numbers too.

Note: Try it

Type GB82 WEST 1234 5698 7654 32 (a correct British IBAN) and click outside the field: “This IBAN is from a country that can’t be used here.” A German IBAN such as DE89 3704 0044 0532 0130 00 is accepted.

EU VAT numbers

->type(IdType::EuVat) checks the format of each EU country and Northern Ireland (XI), and saves the number in upper case without spaces. Greece is saved as EL even when typed as GR.

Note: Try it

Type de 123 456 789 and press “Show what would be saved”: "DE123456789". Then type gr 094014201: it is saved as "EL094014201".

A VAT number typed without its country

->country('DE') adds the country code when people type only the digits.

Note: Try it

Type 123456789 and press “Show what would be saved”: "DE123456789".

Following the country field

->countryField('country') reads the country from another field of the form ('../country' inside a repeater). It works for VAT numbers and postal codes.

Note: Try it

Choose the Netherlands in “Country”, type 123456789B01 and press “Show what would be saved”: "NL123456789B01". Choose Germany and type 123456789: "DE123456789".

Checking that the number is registered

->lookup() asks the EU’s VIES service, when you leave the field, whether the VAT number is registered, and shows the registered name and address under the field. The answer is kept for a day. When VIES doesn’t answer, the field says so and saving still works.

Note: Try it

Type IE6388047V and click outside the field. After a moment: “Registered: GOOGLE IRELAND LIMITED, 3RD FLOOR, GORDON HOUSE … (VIES)”. This is a real request to VIES.

Checking with your own service

->lookupUsing(fn (IdType $type, string $number): array => ...) checks the number with your own code instead of VIES, and returns status, name, address and source. This demo uses it to give fixed answers for the made-up numbers of its customers.

Note: Try it

Type DE123456789 and click outside the field: “Registered: Nordlicht Werkzeuge GmbH — Hafenstraße 12, 20457 Hamburg” appears at once. VIES doesn’t know this made-up number: the answer comes from the demo’s code.

Filling other fields from the registration

->afterLookup(fn (array $result, Set $set) => ...) shows “Use these details” under a registered number. Clicking it fills other fields. It never overwrites them by itself.

Note: Try it

Type de 298 765 431 and click outside the field. Under it: Rheinblick Bürobedarf GmbH and “Use these details”. Click the button: the company name and address are filled in.

Refusing unregistered numbers

When VIES says a number isn’t registered, the field only warns. ->lookup(rejectUnregistered: true) also refuses to save it.

Note: Try it

Type DE999999999 and click outside the field: “VIES says this number isn’t registered.” Press “Show what would be saved”: the field is refused with “This VAT number isn’t registered. Check the number with the company.”

UK VAT numbers

->type(IdType::GbVat) checks the format and the check digits of a UK VAT number, shows it as GB 980 7806 84 and saves it as GB980780684.

Note: Try it

Type 980 7806 84 and click outside the field: GB 980 7806 84. Press “Show what would be saved”: "GB980780684". Type 980 7806 85: one digit is wrong.

Swiss company numbers (UID)

->type(IdType::ChUid) checks the format and the check digit, shows the number as CHE-116.281.710 and saves it as CHE116281710. A MWST, TVA or IVA after the number is dropped.

Note: Try it

Type CHE-116.281.710 MWST and press “Show what would be saved”: "CHE116281710".

Choosing the kind of number from another field

->idType(fn (Get $get) => ...) picks the kind of number with a closure, for example from a select. (->type() with a text still sets the HTML input type, as in TextInput.)

Note: Try it

Type de89 3704 0044 0532 0130 00 while IBAN is chosen: it is grouped by four. Choose UK VAT in “Kind of number” and type 980780684: GB 980 7806 84.

Japanese invoice registration numbers

->type(IdType::JpInvoice) checks T followed by 13 digits and the check digit. The T is added for you, and full-width digits and hyphens are read too.

Note: Try it

Type 7000012050002 and click outside the field: T7000012050002. Type 7000-0120-50002 in full-width digits: the same number.

Japanese corporate numbers

->type(IdType::JpCorporate) checks the 13 digits and the check digit (the first digit).

Note: Try it

Type 7000 0120 50002: it is saved as 7000012050002. Type 7000012050003 and click outside the field: the number doesn’t add up.

Checking a Japanese number with the National Tax Agency

For corporate numbers and invoice registration numbers, ->lookup() asks the National Tax Agency’s Web-API. Each needs its own application ID, set on the plugin: ->corporateNumberApiId() and ->invoiceNumberApiId(). Without one, only the format and the check digit are checked and no request is sent. This demo has no application ID.

Note: Try it

Type 7000012050002 and click outside the field: the number is tidied and checked, but no registered name appears, because nothing is asked.

My Number

->type(IdType::JpMyNumber) checks the 12 digits and the check digit, shows the number as 1234 5678 9018 and saves it as 123456789018. To hide it, see “Hiding a saved number” below.

Note: Try it

Type 1234-5678-9018 and press “Show what would be saved”: "123456789018". Type 1234-5678-9019: the check digit is wrong.

EAN-13 and JAN barcodes

->type(IdType::Ean13) checks the 13 digits and the GS1 check digit, and saves the digits only.

Note: Try it

Type 4 006381 333931 and press “Show what would be saved”: "4006381333931". Change the last digit to 2: the check digit is wrong.

UPC-A barcodes

->type(IdType::UpcA) checks the 12 digits of a North American barcode and its check digit.

Note: Try it

Type 0 36000 29145 2 and press “Show what would be saved”: "036000291452".

EAN-8 barcodes

->type(IdType::Ean8) checks the short 8-digit barcode of small packages.

Note: Try it

Type 9638 5074 and press “Show what would be saved”: "96385074".

GTIN-14 for cases and cartons

->type(IdType::Gtin14) checks the 14 digits printed on cases and cartons.

Note: Try it

Type 1 0012345 67890 2 and press “Show what would be saved”: "10012345678902".

Any barcode length

->type(IdType::Gtin) takes any of the four lengths (8, 12, 13 or 14 digits), for a field that holds every kind of barcode.

Note: Try it

Type 96385074, then 4006381333931: both are accepted. Type 1234567 and click outside the field: “This barcode number (GTIN) should have 8 / 12 / 13 / 14 digits.”

Book numbers (ISBN-13)

->type(IdType::Isbn13) checks the 978 or 979 start and the check digit. An older ISBN-10 is turned into an ISBN-13.

Note: Try it

Type the ISBN-10 0-306-40615-2 and press “Show what would be saved”: "9780306406157".

Older book numbers (ISBN-10)

->type(IdType::Isbn10) checks the check digit, where an X is allowed at the end. An ISBN-13 that starts with 978 is turned back into an ISBN-10.

Note: Try it

Type 978-0-306-40615-7 and press “Show what would be saved”: "0306406152". Type 979-10-90636-07-1 and click outside the field: it has no ISBN-10.

Postal codes of the chosen country

->type(IdType::PostalCode) knows the format of about 55 countries. With ->countryField('country') it follows the country field and tidies the code again when the country changes. Other countries accept 2 to 10 letters and digits.

Note: Try it

With the United States, type 021101234: 02110-1234. Choose Canada and type k1a0b1: K1A 0B1. Choose the United Kingdom and type sw1a1aa, then click outside the field: SW1A 1AA.

Postal codes of one country

->country('JP') fixes the country. Without it, the panel’s country is used.

Note: Try it

Type 1000001 in full-width digits: it becomes 100-0001.

The same rules without the field

PostalCode::format() and PostalCode::validate() give the same results from PHP, for imports or for your own address fields. Below the field are their answers for Japan.

Note: Try it

Type 1000001: format gives '100-0001' and validate gives true. Type 10000: validate gives false.

PostalCode::format(…, 'JP') = NULL PostalCode::validate(…, 'JP') = false

Card numbers are checked, never saved

->type(IdType::CreditCard) checks the Luhn check digit and the length for the brand, and shows the brand under the field. It does not save the number: the field is left out of the saved values, and a note tells people not to save card numbers (PCI DSS).

Note: Try it

Type 4111111111111111: it becomes 4111 1111 1111 1111 and “Visa” appears. Press “Show what would be saved”: the card number is not there.

Don’t save card numbers (PCI DSS). This field only checks the number before it goes to the payment screen.

Only some card brands

->cardBrands([CardBrand::Visa, CardBrand::Mastercard]) accepts only those brands.

Note: Try it

Type the American Express test number 3782 822463 10005 and click outside the field: “Only these cards can be used: Visa, Mastercard.”

Don’t save card numbers (PCI DSS). This field only checks the number before it goes to the payment screen.

Without the note about card numbers

->cardWarning(false) hides the note under the field, for example when the screen already explains it.

Note: Try it

Compare with the card fields above: there is no note under this one.

Hiding a saved number

->masked() shows only the last 4 characters until the field is touched, so a number can’t be read over someone’s shoulder. The full number isn’t in the page until then. Saving without touching the field keeps the saved number.

Note: Try it

The field shows •••• •••• •••• •••• ••30 00. Click it: the whole IBAN appears. Press “Show what would be saved” without changing it: "DE89370400440532013000".

How much is shown, and with which character

->masked(keep: 2, character: '*') shows only the last 2 characters and hides the rest with *.

Note: Try it

The field ends in 18 and the other digits are *. Click it to see the whole number.

Who may see a hidden number

->revealableWhen(fn () => ...) decides who may see the number; the server checks it before sending the number. People who may not see it can still type a new number to replace it. Here it is false.

Note: Try it

Click the field: “You can’t see the whole number. Type a new one to replace it.” Type 1234 5678 9018 and press “Show what would be saved”: "123456789018".

Doing something when a number is shown

->onReveal(fn () => ...) runs when a hidden number is shown, for example to write who looked at it to an activity log. Here it shows a notification.

Note: Try it

Click the field. The IBAN appears, and a notification says the number was shown.

Numbers in order

SequenceInput::make('number')->sequence('DEMO-{Y}-{0000}') gives each new record the next number. The number is taken when the record is saved, so two people never get the same number, and a form that is never saved leaves no gap. Under the field is the number it would get. {Y} starts again at 1 every year.

Note: Try it

Read the estimate under the field. Press “Show what would be saved”: the field takes that number (saving does the same), and the estimate moves on by one.

Gets the number DEMO-2026-0001 when you save (estimate).

Starting again every month

{Ym} puts the year and month in the number, and the count goes back to 1 every month. {Ymd} does the same every day. {000} sets the number of digits.

Note: Try it

Press “Show what would be saved”: a number such as Q-202611-001.

Gets the number Q-202611-001 when you save (estimate).

A counter for each branch

A closure can give each branch its own prefix: ->sequence(fn (Get $get) => $get('branch').'-{Y}-{0000}'). Each prefix is counted separately, unless you give all of them one counter name in the second argument.

Note: Try it

Press “Show what would be saved” twice with Boston: the BOS number goes up by one each time. Choose New York: the estimate is NYC-2026-0001 (or higher if others tried it), because New York has a counter of its own.

Gets the number BOS-2026-0001 when you save (estimate).

Typing a number by hand

The field is read-only by default. ->allowManual() lets people type a number; an empty field still gets the next number, and numbers typed by hand are skipped.

Note: Try it

Leave the field empty and press “Show what would be saved”: the next number. Then type M-0500 and press it again: "M-0500".

Leave it empty to get M-0001 when you save (estimate), or type a number yourself.

Continuing from an older system

The start: argument sets the first number, so numbering can continue where an older system stopped. {0} means no padding.

Note: Try it

The estimate is INV-5001 (or higher if others tried it). Press “Show what would be saved” to take it.

Gets the number INV-5001 when you save (estimate).

Which day it is, in which time zone

->timezone('Asia/Tokyo') decides the time zone of {Y}, {m} and {d} (by default Filament’s time zone), so an invoice saved on New Year’s Eve gets the right year.

Note: Try it

Compare the dates in the two estimates. Between midnight in Tokyo and midnight in Los Angeles (17 hours), Tokyo is already one day ahead.

Gets the number JP-20261123-01 when you save (estimate).

Gets the number LA-20261122-01 when you save (estimate).

The same counters from PHP

Sequence::next() takes the next number and Sequence::peek() shows it without taking it, for imports and APIs. The counters live in the warp_input_sequences table of the plugin’s migration.

Note: Try it

This is Sequence::peek() for the order numbers of the first section. Take a number there and reload the page: this moves on too.

Sequence::peek('examples', 'DEMO-{Y}-{0000}') = 'DEMO-2026-0001'

Saved numbers in tables and details

IdColumn and IdEntry show a saved number in its display shape. With ->copyable(), copying gives the saved shape. For postal codes, ->countryAttribute('country') reads the country from the record, or ->country('US') fixes it.

Note: Try it

All three show saved numbers: DE89370400440532013000, GB980780684 and 021101234. Click the IBAN to copy it.

DE89 3704 0044 0532 0130 00
GB 980 7806 84
02110-1234

Hidden numbers in tables and details

MaskedColumn and MaskedEntry show only the last characters (->keep(4)). People who may see the number click the cell, or the eye button of the entry, to open a small window with the whole number and a copy button. ->revealableWhen() and ->onReveal() work as in the field.

Note: Try it

Click the eye button: a small window shows DE89 3704 0044 0532 0130 00 with a copy button.

  • •••• •••• •••• •••• ••30 00

Checking numbers outside the field

The rule new ValidId(IdType::Iban) checks a number in your own validation, for APIs and imports. country:, countries: and rejectUnregistered: work as in the field. This field is a plain TextInput with that rule.

Note: Try it

Type DE89 3704 0044 0532 0130 01 and press “Show what would be saved”: “This IBAN doesn’t add up.” With 00 at the end it is accepted.

The saved, shown and hidden shapes from PHP

Id::store() gives the saved shape, Id::display() the shown shape and Id::mask() the hidden one, so numbers from an import end up in the same shape as numbers from the field.

Note: Try it

Type de89 3704 0044 0532 0130 00 and read the three answers below the field.

Id::store() = NULL Id::display() = NULL Id::mask() = NULL