参数不匹配,pattern是一个字符串,而replace是插入pivot值-laravel时的数组

I'm new to laravel. When i try to insert data using pivot values (item has many items in assembly table) , i get this error. Here is my code. I need to convert this array to an string as i understand. but how?

    if (request()->has('copy_item')) {
        $copy = Item::find(request('copy_item'));
        $assemblies = collect($copy->assemblies)->map(function($part) {
            return [
                $part->id => [
                    'quantity' => $part->pivot->quantity,
                    'type' => $part->pivot->type
                ]
            ];
        });

        $item->assemblies()->attach($assemblies);


    }