php - Illegal string offset 'id' laravel 7

one text

Solution:

as per your screen short you don't have $value['id']

it will be like

if (isset($item['value'])) {
            foreach($item['value'] as $key => $value) {
                $filter_item->values()->updateOrCreate(
                    ['id' => $key],
                    ['value' => $value]
                );
            }
        }

as $item['value'] is normal array with only index

Source