Referring related table? belongs_to field? #305
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I think you're having issues because you're trying to use the handle: user
field:
type: text
display: Email Instead, what you can do is add an accessor to your Eloquent model that gets the email from the user, then use a text field with the same that name to display the user's email. class Subscription extends Model
{
protected $casts = [
'user_email',
];
public function userEmail(): string
{
return $this->user->email;
}
} handle: user_email
field:
type: text
display: Email |
Beta Was this translation helpful? Give feedback.
-
I received an answer on the Statamic Discord which solved the issue:
|
Beta Was this translation helpful? Give feedback.
I received an answer on the Statamic Discord which solved the issue: