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

Email addresses

EmailInput replaces TextInput::make('email')->email(). It keeps the email rule and everything else TextInput does, fixes typing mistakes, and saves every address in one tidy form. Warnings about customers who already have the address are on the “Duplicate warnings” page.

Fixes for typing mistakes

When you leave the field, a typo in a common mail domain gets a one-click fix under the field. Nothing changes until you click it. This is on by default; it knows about 120 mail services in many countries.

Note: Try it

Type taro@gmail.con and click outside the field. “Did you mean taro@gmail.com?” appears — click the address to use it. Then try ann@yahoo.co.jo.

Suggest your own domains too

->commonDomains(['harborsupply.com']) adds domains the field doesn’t know, such as your company’s or your biggest customers’. They are checked first.

Note: Try it

Type sales@harborsuply.com (one p is missing) and click outside the field. It suggests sales@harborsupply.com.

Without suggestions

->suggestions(false) turns the suggestions off, for example on a sign-in form where the address must be typed exactly.

Note: Try it

Type taro@gmail.con and click outside the field. No suggestion appears.

Tidy addresses

Spaces, full-width characters and a leading mailto: are removed, and the part after @ is lower-cased. The same happens on the server, so addresses from the API or from tests are saved the same way.

Note: Try it

Type  Taro.Yamada@Gmail.COM  with spaces around it and press “Show what would be saved”: Taro.Yamada@gmail.com. Then paste mailto:orders@acme.com.

All lower case

->lowercase() lower-cases the whole address, not only the part after @. It is off by default, because a few mail servers treat the part before @ as case-sensitive.

Note: Try it

Type Taro.Yamada@Gmail.COM and press “Show what would be saved”: taro.yamada@gmail.com.

Warn about throw-away addresses

Throw-away addresses (such as mailinator.com) work without signing up and stop working after a while. ->warnDisposable() shows a warning under the field, but the form still saves. The list of about 10,000 domains ships with the package.

Note: Try it

Type someone@mailinator.com and click outside the field. A warning appears. Press “Show what would be saved”: the address is still saved.

Refuse throw-away addresses

->rejectDisposable() refuses throw-away addresses with an error, so the form can’t be saved with one. Subdomains count too.

Note: Try it

Type someone@x.mailinator.com and press “Show what would be saved”. An error appears under the field and nothing is saved.

The same check without EmailInput

The check is also a validation rule, new NotDisposableEmail. This field is Filament’s plain TextInput with ->rule(new NotDisposableEmail); in a controller use it in $request->validate(). Email::isDisposable() answers the same question in your own code.

Note: Try it

Type someone@mailinator.com and press “Show what would be saved”. The same error appears, although this field has no suggestions and no warning.

Check that the domain can receive mail

Warp Input doesn’t look anything up on the network. To check that the domain really receives mail, add Laravel’s ->rule('email:dns'): the server looks for the domain’s mail servers when the form is saved.

Note: Try it

Type orders@baysidegrocers-no-mail.com and press “Show what would be saved”. The domain has no mail servers, so an error appears. orders@gmail.com is accepted.

Saved addresses in tables and details

Filament’s own TextColumn and TextEntry already do what an email column needs, so Warp Input doesn’t add one: ->url(fn ($state) => "mailto:{$state}") makes a link and ->copyable() copies it.

Note: Try it

Click the address: “Copied” appears and the address is copied. It is also a mailto: link, so your mail app opens too.