Select list: How to handle soft deleted (trashed) relations?
In my form for a QuoteResource I have a Repeater with in there a Selectlist that uses a relation to select a product:
Now say the product get soft deleted in the meantime. If I go back to editing my quote in which this product was previously selected the selectlist now shows up empty because the product is of course deleted. I expect it to be still filled with the trashed product, but when trying to select a different product it should not show up available for selection.
I've tried adding
Can anybody point me to how to handle this kind of situation?
Now say the product get soft deleted in the meantime. If I go back to editing my quote in which this product was previously selected the selectlist now shows up empty because the product is of course deleted. I expect it to be still filled with the trashed product, but when trying to select a different product it should not show up available for selection.
I've tried adding
modifyQueryUsing: fn( Builder $query ) => $query->withTrashed() to the relationship parameters but this makes deleted products available for selection when adding a new item as well.Can anybody point me to how to handle this kind of situation?