Tricks

Add a link to field hint() and helperText()

Aug 9, 2022
Andrew Peacock
Admin panel, Form builder

The hint() and helperText() functions support markdown, so you just need to add the link in Markdown format.

However, Laravel markdown does not support relative links, so if you need a link that works in different environments, you need to build that URL using Laravel's url() function:

TextInput::make("cost")
->suffix(auth()->user()->settings()->get("currency", "USD"))
->hint("[Change currency](" . url("/settings") . ")"),
avatar

HOW TO Add a link AS target="_blank"

avatar

HOW TO Add a font color at helperText