F
Filamentβ€’5mo 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
lazydogβ€’5mo ago
I would like to add this one "heroicon-s-heart" but no icon has shown
Dennis Koch
Dennis Kochβ€’5mo ago
Use new HtmlString() combined with Blade::render("@svg('heroicon-s-heaert')")
lazydog
lazydogβ€’5mo 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 Kochβ€’5mo ago
Did you change the return type? Or is it still string?
lazydog
lazydogβ€’5mo ago
still string
Dennis Koch
Dennis Kochβ€’5mo 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.