© 2026 Hedgehog Software, LLC

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

How implement a filter in a filament resource that uses the attribute of a HasOne relationship

Hello everyone. I have a question, how can I implement a filter in a filament resource that uses the attribute of a HasOne relationship. For example, I have two models Author and Profile, where Author hasOne Profile and Profile belongsTo Author. In profile there is the boolean attribute is_featured. What I want is to filter the list of authors by that attribute. I tried TernaryFilter::make('profile.is_featured') but it shows me all the authors.
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

Adding a "hasOne" relationship in the resource view.
FilamentFFilament / ❓┊help
2y ago
refresh select filter that uses an attribute
FilamentFFilament / ❓┊help
6mo ago
Form HasOne relationship
FilamentFFilament / ❓┊help
3y ago
Is it possible to implement HasOne relationship in Registration page?
FilamentFFilament / ❓┊help
2y ago