$table->foreign Id('user_id')->constraint()->on Delete('cascade'); code example
Example: cascade in laravel migration
$table->dropForeign('answers_user_id_foreign');
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');
$table->dropForeign('answers_user_id_foreign');
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade');