If I have 3 tables:
User, Conversation, Messages
Between User and conversation I have:
$table->foreign('user_id') ->references('id') ->on('users') ->onDelete('cascade');
And between conversation and messages:
$table->foreign('conversation_id') ->references('id') ->on('conversations') ->onDelete('restrict');
If someone accidentally try to delete conversation, it should stop him because of messages restriction. But same way user is deleted I want to delete both conversation and messages.
How can I accomplish that?