NotAssignedToReactable exception when trying to access deleted item
Marchiuzzz opened this issue · comments
Hi, I have noticed an issue when trying to access the reactable object from a reaction like so
$item->getReactant()->getReactable()
for a deleted item (an object that uses soft deletes)
I just get thrown NotAssignedToReactable exception, shouldn't it handle this on it's own?
You cannot get soft deleted Reactable model from the Reactant using getReactable
method at this moment, but you can do it this way:
$item->getReactant()->reactable()->withTrashed()->first()
Thanks for the workaround! Though I already figured another way to tackle this, with try-catch, if trying to get reactable throws an error, I know that item was deleted.