Relation manager attach one-to-many

I have a relation manager between projects and purchace_invoices (one-to-many).
In the relation manager I want to be able to attach existing purchase invoices to a project, but I cant see to figure out how.
Solution
Action::make('aankoopfactuurKoppelen')
                    ->color('gray')
                    ->form([
                        Select::make('id')
                            ->label('Purchase Invoice')
                            ->options(PurchaseInvoice::query()->pluck('invoice_number', 'id'))
                            ->native(false)
                            ->multiple()
                            ->searchable()
                            ->required(),
                    ])
                    ->action(function (array $data): void {
                        PurchaseInvoice::whereIn('id', $data['id'])->update(['project_id' => $this->ownerRecord->id]);
                    })

This fixed it
Was this page helpful?