Answer the question
In order to leave comments, you need to log in
Do I have to somehow soft delete the pivot table if I'm doing it on the models themselves?
Intuitively, as if it should. If yes, what is the best way to do it? Subscribe to events (they are guaranteed to work)? Transactions?
Answer the question
In order to leave comments, you need to log in
No, if you are talking about money-mani. The pivot table just defines the relationship, and the relationship between soft-deleted entities does not need to be removed. You don’t need to hack anything, do as in the documentation and it will be right - fortunately, in Lara it is excellent.
No, use a foreign key for the pivot table , and when the model is physically deleted from the database, records in the pivot will automatically be deleted too
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question