so $request->node_id is an array?
And you want to delete all other records apart from those in the array?
Does the delete work?
This foreach($request->menu as $item => $key) is the wrong way around if you actually mean $item and $key
The normal format is soreach($request->menu as $key => $item)
But as you don't use $key, foreach($request->menu as $item)
Actually, your life would be easier if you renamed your form inputs like
name="menu[][name]"
name="menu[][link]"
name="menu[][target"]
Then you would be working with a proper associated array and not a numeric array