0

I've three tables Users, company and user_company (pivot). I need to, for example, associate users to a company in a form using select that show me only the user are nit associated to this company. Could anybody help me? Thanks in advance

Karin
  • 1

2 Answers2

0

check the Filaments Documentation on the relationshipmanager AND #Attaching and detaching records either manually or by --attach when creating the relationship manager

Ensure withPivot is included in the EloquentModel and check the getRelations in the modelresource

0

See docs #Populating automatically from a relationship

This works for me:

Forms\Components\Select::make('companyId')
                ->multiple()
                ->relationship('companies','company_name'),