I have user_id fk column in my table
$table->foreign(\'user_id\')->references(\'id\')->on(\'users\');
I should add on cascade
Thanks for question answer. Help me get to this working code in L5.1 :
public function up()
{
Schema::table('transactions', function (Blueprint $table) {
$table->dropForeign('transactions_order_id_foreign');
$table->foreign('order_id')
->references('id')->on('orders')
->onDelete('cascade')
->change();
});
Schema::table('orders', function (Blueprint $table) {
$table->dropForeign('orders_user_id_foreign');
$table->foreign('user_id')
->references('id')->on('users')
->onDelete('cascade')
->change();
});
}