how do i delete a relation using mysql laravel?

You have a cascade foreign key on your mail_task_mail_message table, so you only need to do:

MailTask::whereNotNull('deleted_at')->forceDelete();

You have to use forceDelete() to actually delete the register instead of just setting deleted_at column.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top