I'm using soft-delete with my currency model and would like to enforce foreign key integrity by checking that regions hasMany relationship is empty before any currency is allowed to be deleted. Will validation be performed on $currency->delete() call? If not, is there a way to enforce this behaviour on the model level (to avoid replicating same logic in multiple places)?
I'm using soft-delete with my
currency
model and would like to enforce foreign key integrity by checking thatregions
hasMany relationship is empty before any currency is allowed to be deleted. Will validation be performed on$currency->delete()
call? If not, is there a way to enforce this behaviour on the model level (to avoid replicating same logic in multiple places)?