Adds https://
Nobody types https:// any more. When you leave the field, it adds it, and the server does the same before saving. Addresses that start with http:// stay http://.
Note: Try it
Type example.com and click outside the field: it becomes https://example.com. Then try www.example.com/products and http://example.com.
Lower-cases the site name
The site name (the part before the first /) is lower-cased. The rest keeps its capital letters, because many sites treat them as different pages.
Note: Try it
Type Example.COM/About-Us and click outside the field: it becomes https://example.com/About-Us.
Removes tracking parameters
Links copied from newsletters and ads carry parameters that only tell the sender where you came from. ->stripTracking() removes them (utm_*, fbclid, gclid and about 20 more). Other parameters keep their order.
Note: Try it
Paste https://shop.example.com/item?utm_source=news&id=7&fbclid=abc and click outside the field: it becomes https://shop.example.com/item?id=7.
Only some sites
->domains(['harborsupply.com']) accepts only that site and its subdomains. The field warns as soon as you leave it, and the server refuses other sites.
Note: Try it
Type portal.harborsupply.com/orders and press “Show what would be saved”: it is saved. Then type example.com, or evil-harborsupply.com, and press it again: an error appears.
An X profile
->social('x') makes the field a profile field. You can type the username or paste the link; the field saves the profile’s address. Old twitter.com links are saved as x.com. The logo is shown on the left.
Note: Try it
Type @warpui and click outside the field: it becomes https://x.com/warpui. Then try x.com/warpui and https://twitter.com/warpui?s=20.
Text that isn’t a profile
Anything that isn’t a profile on that network, such as another site or a page of X that isn’t a person, gets a notice under the field and can’t be saved. The network can also be given as an enum: ->social(SocialNetwork::X).
Note: Try it
Type x.com/home and press “Show what would be saved”: a notice and an error appear. Then try example.com/warpui.
A LinkedIn profile
->social('linkedin') reads people and companies. A name alone is a person (/in/); write company/ in front for a company page.
Note: Try it
Type jane-doe in the left field: https://www.linkedin.com/in/jane-doe. Type company/acme in the right field: https://www.linkedin.com/company/acme.
A Facebook page
->social('facebook') also reads short fb.com links and pages that only have a number (profile.php?id=…).
Note: Try it
Type fb.com/acme: https://www.facebook.com/acme. Then type facebook.com/profile.php?id=100064: the number is kept.
A YouTube channel
->social('youtube') reads the channel’s @name, a name without @, and links with the channel ID (youtube.com/channel/UC…).
Note: Try it
Type warpui: https://www.youtube.com/@warpui. Then paste youtube.com/channel/UC_x5XG1OV2P6uZZ5FSM9Ttw: the link is kept with the channel ID.
A Threads profile
->social('threads') saves threads.com addresses. Old threads.net links become threads.com.
Note: Try it
Type threads.net/@warpui and click outside the field: it becomes https://www.threads.com/@warpui.
A Bluesky profile
->social('bluesky') adds .bsky.social to a plain name. People who use their own domain as their name keep it.
Note: Try it
Type @warpui: https://bsky.app/profile/warpui.bsky.social. Then type warpui.com: https://bsky.app/profile/warpui.com.
A Mastodon profile
Mastodon runs on many servers, so ->social('mastodon') needs the server too: @name@server, or the link to the profile.
Note: Try it
Type @warpui@mstdn.jp: https://mstdn.jp/@warpui. Then type only @warpui and press “Show what would be saved”: an error appears, because the server is missing.
Instagram, GitHub and TikTok
->social('instagram'), ->social('github') and ->social('tiktok') work the same way: type the @name or paste the link.
Note: Try it
Type @warp.ui in Instagram, @qalainau in GitHub and @warpui in TikTok, then press “Show what would be saved”.
The profile rule without UrlInput
The check is also a validation rule, new SocialProfile(SocialNetwork::X). This field is Filament’s plain TextInput with that rule: it accepts profiles and refuses anything else, but saves the text as typed. SocialNetwork::X->profileUrl('@warpui') gives the profile’s address in your own code.
Note: Try it
Type @warpui and press “Show what would be saved”: @warpui is saved as typed. Then type example.com: an error appears.
Saved addresses in tables and details
UrlColumn and UrlEntry show the address short, without https://, www. and the last /, and open it in a new tab. The full address is shown when you point at it, and ->copyable() copies the full address.
Note: Try it
Point at harborsupply.com/products: the full address https://www.harborsupply.com/products/ appears. Clicking it copies it and opens the site in a new tab.
Mastodon profiles in tables and details
Mastodon servers can have any name, so they can’t be recognised by the address. Add ->social('mastodon') to the column or entry to show the logo and @name@server.
Note: Try it
Compare the two: the same saved address https://mstdn.jp/@warpui is shown as mstdn.jp/@warpui on the left and as the Mastodon logo and @warpui@mstdn.jp on the right.
How much of a long address to show
->limitUrl(30) shows 30 characters of the site name and path and then …. The default is 40.
Note: Try it
The long address is cut after 30 characters. Point at it to see all of it.
Profiles as plain addresses
->detectSocial(false) always shows the short address, without logo and username.
Note: Try it
The saved address https://x.com/warpui is shown as x.com/warpui, not as the X logo and @warpui.
Only web addresses become links
Only addresses that start with http:// or https:// become links. Anything else, such as javascript: that runs code when clicked, is shown as plain text.
Note: Try it
javascript:void(0) is shown as text: clicking it does nothing.