laravel eloquent remove all then attach code example
Example 1: laravel delete where
DB::table('users')->where('id', $id)->delete();
Example 2: laravel 7 eloquent on delete set null schema
$table->foreignId('user_id')
->constrained()
->onDelete('cascade');