© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3mo ago•
5 replies
Vp

Single select with belongsToMany relationship

I have a tenant system, users with teams. I want to create user and attach it to teams (team_user database), but I want to select only one team on select form because user can be in one team only, not on multiple. how can I do this correctly?

Select::make('team')
    ->relationship('teams', 'name')
    // ->multiple() // if enable, works correctly
    ->preload(),
Select::make('team')
    ->relationship('teams', 'name')
    // ->multiple() // if enable, works correctly
    ->preload(),
Solution
I use normal Select or relationship (without multiple) and handle manually using Lifecycle Hooks
Jump to solution
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

Multiple Select with BelongsToMany relationship
FilamentFFilament / ❓┊help
3y ago
Relationship belongstoMany
FilamentFFilament / ❓┊help
3y ago
Save MM relationship with single select
FilamentFFilament / ❓┊help
3y ago
select filter with belongsToMany
FilamentFFilament / ❓┊help
3y ago