-
Beta Was this translation helpful? Give feedback.
Answered by
igmltd
May 26, 2024
Replies: 1 comment
-
Found it in the docs, managed to do it with a computed field - adding the below to the model. public function fullName(): Attribute |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
igmltd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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';
}
);
}