Skip to content

Display relationship field in column #502

Closed Answered by igmltd
igmltd asked this question in Help
Discussion options

You must be logged in to vote

Found it in the docs, managed to do it with a computed field - adding the below to the model.

public function fullName(): Attribute
{
return Attribute::make(
get: function () {
return $this->listing ? $this->listing ->fullname : 'Unknown';
}
);
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by igmltd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant