I create fields using relationships
BelongsTo::make
and want to add a search title image, the link to the image is stored as a url in the resource field
I tried making an img tag but the title escaped the html code
public function title() { return "$this->name <img src='/open_emoji/lite_colored/$this->name.png'>"; }
https://nova.laravel.com/docs/4.0/resources/relationships.html#searchable-relations The documentation shows a picture to show that this is possible and that's it!
There is also a specific avatar field, but it's also poorly documented, and there's no explanation of how relationships are handled.
Can someone explain how to do this? I am using nova 4
P粉9365685332024-04-01 16:39:08
So we need to use
in the sub-resource avatar fieldDocumentation: If a resource contains an avatar field, this field will appear next to the resource title when the resource appears in search results. https://nova.laravel.com/docs/4.0/ resources/fields.html#avatar-field