i have table called users, if i want to delete some user (User can add questions and add respondents (who will answer on his questions)), i need to delete him and get his id to people who deleted this person. So for example:
i have table called users , if i want to delete some user (User
Share
Sure.
Now use this method instead of the “destroy” method.
OR
you can stick to callbacks like this
Then you can :
Just a couple of ideas! Good Luck!
Update: All the code i provided above belongs in your model.
In your controller you need to have a destroy method
in your controller
Change to suite your need of course!