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...
@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;
}
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.