I have a morphedByMany multiplies relations

I have a morphedByMany relationship and this code Forms\Components\Select::make('products') ->multiple() ->relationship('products', 'name') ->getSearchResultsUsing(fn (string $search) => Product::where('name', 'like', "%{$search}%") ->orWhere('sku', 'like', "%{$search}%") ->limit(10)->pluck('name', 'id')) ->getOptionLabelUsing(fn ($value): ?string => Product::find($value)?->name), It is multiplying the entries in the table, it should sync instead of save?
2 Replies
Dan Harrin
Dan Harrin15mo ago
maybe open an issue if you think its a bug
fede8100
fede810015mo ago
I was asking because I'm not sure if it's a bug or I'm doing something wrong ok, I will