belongsToMany select for relation not working

anyone knows what I'm doing wrong in this Select field with relation BelongsToMany using pivot table public function users() { return $this->belongsToMany(User::class, 'section_users', 'id_section, 'user_id'); } in my form I have:
Select::make('users')
->searchable()
->live(onBlur: true)
->multiple()
->relationship(
'users',
'nume',
modifyQueryUsing: fn (Builder $query, Get $get) => $query->where('disabled', 0)
)
->preload()
->required(),
Select::make('users')
->searchable()
->live(onBlur: true)
->multiple()
->relationship(
'users',
'nume',
modifyQueryUsing: fn (Builder $query, Get $get) => $query->where('disabled', 0)
)
->preload()
->required(),
i can select users in the field, but when i save the form, the relation is not saved, works just fine if i use a relation manager for that relation
1 Reply
jamesro
jamesroOP2mo ago
Found the issue, i was having a ->model(Sectiuni::class) placed on my form, removed that an everything is oky now

Did you find this page helpful?