Database Queries
Deleting rows with foreign key constraints
Figure out all the relationships of the table of the row you are trying to delete (go to model_name.php and check for belongsToMany, HasMany, etc.)
Create a delete helper function in model_name.php and use
detach()
anddelete()
as necessaryCall this function in the controller
Last updated