F
Filament14mo ago
lazydog

Heading Icon

How can I add an icon to getHeading method from ViewRecord? public function getHeading(): string { return "Viewing text <icon here>"; }
6 Replies
lazydog
lazydogOP14mo ago
I would like to add this one "heroicon-s-heart" but no icon has shown
Dennis Koch
Dennis Koch14mo ago
Use new HtmlString() combined with Blade::render("@svg('heroicon-s-heaert')")
lazydog
lazydogOP14mo ago
I've tried this one new HtmlString(Blade::render("@svg('heroicon-s-heart')")); but no luck. May I know what I've missed?
Dennis Koch
Dennis Koch14mo ago
Did you change the return type? Or is it still string?
lazydog
lazydogOP14mo ago
still string
Dennis Koch
Dennis Koch14mo ago
You should change the return type if you change the value you return 😉 Maybe you need to override getHeader() because heading only allows string not sure.

Did you find this page helpful?