You question is not clear, please always provide your code, or example !
Display specific values in relation
Good day! There is the essence of the game in which first_team_id and second_team_id are stored. When the player first_team_id or second_team_id is added to the game resource, all players will be displayed. And I need to display only those players whose id matches first_team_id and second_team_id.
BelongsToMany::make('First team', 'first_team_players', Player::class)->display('name') displays only the name of the player, how can I display both the name and surname
I think you are talking about Nova. I check the Laravel Nova docs and it seems that you can override the title() function to customise the display.
public function title()
{
return “{$this->name} {$this->surname}”;
}
Please or to participate in this conversation.