Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

alev's avatar
Level 4

show different field than name for belongsTo

In my Reminders resource in Nova I show the user with belongsTo. Automatically it displays the first_name of user.

But, instead of displaying the name of the user, I want to display the email.

How is that possible? I couldn't find a way to do this...

0 likes
2 replies
MichalOravec's avatar
Level 75

@alev You can find it in documentation

From docs: https://nova.laravel.com/docs/3.0/resources/relationships.html#belongsto

To customize the "title" attribute of a resource, you may define a title property on the resource class:

public static $title = 'email';

Alternatively, you may override the resource's title method:

/**
 * Get the value that should be displayed to represent the resource.
 *
 * @return string
 */
public function title()
{
    return $this->email;
}
1 like
alev's avatar
Level 4

Ah. Now I get it. I had to set the title on the resource Users and not on the resourceReminders, event hough I want to show it on Reminders.

Please or to participate in this conversation.