图片和名称作为标题

时间:2018-10-15 14:52:58

标签: laravel laravel-nova

我正在构建Laravel Nova应用程序,并希望向用户显示图像和名称。

 /**
 * The single value that should be used to represent the resource when being displayed.
 *
 * @var string
 */
public static $title = 'name';

如您在上面看到的,$ title用于表示资源,但是我想要两个值,图像(Avatar)和名称(Sting)。

这是否可行,或者是否可以显示其他值(例如图像)而不是字符串?

1 个答案:

答案 0 :(得分:0)

使用头像字段

  

如果资源包含“头像”字段,则当该资源显示在搜索结果中时,该字段将显示在资源标题旁边

enter image description here

https://nova.laravel.com/docs/1.0/resources/fields.html#field-types

相关问题