Thomas
FilamentIcon::register view() wrongly (?) rendered as image source
As a workaround I added the Htmlable types and included this in
getIcon
inside the HasIcons
trait:
This looks a bit weird because you're not accepting a renderable, but because a view is both this works.54 replies
FilamentIcon::register view() wrongly (?) rendered as image source
It never worked for two reasons. A view() is stringable. As the
HasIcon
trait didn't have the Htmlable
type, PHP would convert it to string and render the HTML. After the type was added it didn't work either and that's because a view is also Renderable. If you pass a view to another view as a prop it renders all Renderables.54 replies
FilamentIcon::register view() wrongly (?) rendered as image source
I've done some digging but I think that's unrelated. It seems like passing an Htmlable as a prop to a component renders it. When you use an HtmlString it works. Feels like a bug in Laravel but I can't find how that works.
54 replies
FilamentIcon::register view() wrongly (?) rendered as image source
That doesn't matter, Laravel checks if it's an Htmlable element and calls toHtml(), if you check Laravel's source it never checks if something is an HtmlString, it always checks if its Htmlable
54 replies