F
Filamentβ€’9mo ago
morty

How can I add `mailto:` to an email in an infolist text entry?

Things I've tried:
Infolists\Components\TextEntry::make('e_mail')
->label('Email')
->icon('heroicon-m-envelope')
->placeholder('-')
->formatStateUsing(fn (string $state): HtmlString => new HtmlString("mailto:{$state}")),
Infolists\Components\TextEntry::make('e_mail')
->label('Email')
->icon('heroicon-m-envelope')
->placeholder('-')
->formatStateUsing(fn (string $state): HtmlString => new HtmlString("mailto:{$state}")),
Infolists\Components\TextEntry::make('e_mail')
->label('Email')
->icon('heroicon-m-envelope')
->placeholder('-')
->formatStateUsing(fn (string $state): string => "mailto:{$state}")
->html(),
Infolists\Components\TextEntry::make('e_mail')
->label('Email')
->icon('heroicon-m-envelope')
->placeholder('-')
->formatStateUsing(fn (string $state): string => "mailto:{$state}")
->html(),
Both just give me this:
No description
Solution:
Try this. ```php use Illuminate\Support\HtmlString; ...
Jump to solution
5 Replies
Solution
Mansoor Khan
Mansoor Khanβ€’9mo ago
Try this.
use Illuminate\Support\HtmlString;

->formatStateUsing(fn ($state) => new HtmlString("<a href='mailto:{$state}'>{$state}</a>"))
use Illuminate\Support\HtmlString;

->formatStateUsing(fn ($state) => new HtmlString("<a href='mailto:{$state}'>{$state}</a>"))
morty
mortyOPβ€’9mo ago
omg I'm dumb forgot the anchor sheesh Thanks!
Mansoor Khan
Mansoor Khanβ€’9mo ago
Now help me solve mine LOL.
morty
mortyOPβ€’9mo ago
I checked your post out, sorry man I haven't tackled file uploads yet.
Mansoor Khan
Mansoor Khanβ€’9mo ago
Dont be sorry, no problem πŸ™‚
Want results from more Discord servers?
Add your server