laravel delete all with foreign key code example
Example 1: laravel remove foreign key
$table->dropForeign('posts_user_id_foreign');
Example 2: set null on foreign key deletion in laravel
$table->foreignId('forign_id')->nullable()->constrained("table_name")->cascadeOnUpdate()->nullOnDelete();