Answer the question
In order to leave comments, you need to log in
In Laravel, you can somehow delete the model, but with the removal of all linking records?
For example, I want to delete a user $user->delete()
, but in several other places there is a user_id key. So that it deletes the entries with these keys. And those, in turn, can pull something else. To remove all of this. Tried
->forceDelete()
, doesn't help.
Answer the question
In order to leave comments, you need to log in
If foreign keys are installed, then it will drop everything by itself. If not set, then first delete the related entities, then the user itself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question