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