Answers for "laravel delete all data against foreign key"

PHP
1

larael drop foreign key

Schema::table('posts', function (Blueprint $table) {
	$table->dropForeign(['category_id']);
});
Posted by: Guest on May-07-2021
0

set null on foreign key deletion in laravel

$table->foreignId('forign_id')->nullable()->constrained("table_name")->cascadeOnUpdate()->nullOnDelete();
Posted by: Guest on March-21-2021

Code answers related to "laravel delete all data against foreign key"

Browse Popular Code Answers by Language