if (isset($data['items'])) {
$currentSet->items()->detach();
$data['items'] = json_decode($data['items'], true);
foreach ($data['items'] as $item) {
ItemSet::create([
'item_id' => $item['id'],
'amount' => $item['amount'],
'set_id' => $currentSet->id
]);
}
}