Answers for "on delete delete all foreign key constraint in laravel"

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 "on delete delete all foreign key constraint in laravel"

Browse Popular Code Answers by Language