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
maybe open an issue if you think its a bug
I was asking because I'm not sure if it's a bug or I'm doing something wrong
ok, I will