© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
arif

How to Display Related Model Data on the Edit Page?

I have two models: User and DetailUser. I want to display the name from DetailUser on the edit page. However, I'm unable to display it using
detailUser.name
detailUser.name
. Why is this happening?

Model User.php
public function userDetail()
{
    return $this->hasOne(UserDetail::class, 'user_id', 'id');
}
public function userDetail()
{
    return $this->hasOne(UserDetail::class, 'user_id', 'id');
}


Model UserDetail.php
public function user()
{
    return $this->belongsTo(User::class, 'user_id', 'id');
}
public function user()
{
    return $this->belongsTo(User::class, 'user_id', 'id');
}
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

how to display data edit
FilamentFFilament / ❓┊help
2mo ago
How do I only display data related to the model loaded into the panel?
FilamentFFilament / ❓┊help
14mo ago
files not display on edit page
FilamentFFilament / ❓┊help
15mo ago