public function updateItemsData($items)
    {
        $items->each(function ($item) {
            CartItem::where('id', $item->id)->update([
                'name' => $item->name,
                'price' => $item->price,
                'image' => $item->image,
            ]);
        });
    }
public function updateItemsData($items)
    {
        $items->each(function ($item) {
            CartItem::where('id', $item->id)->update([
                'name' => $item->name,
                'price' => $item->price,
                'image' => $item->image,
            ]);
        });
    }
public function updateItemsData ( $ items ) { $ items -> each ( function ( $ item ) { CartItem :: where ( 'id' , $ item -> id ) -> update ( [ 'name' => $ item -> name , 'price' => $ item -> price , 'image' => $ item -> image , ] ) ; } ) ; }
Updates the details in the cart items table.

@param \Illuminate\Support\Collection Cart items
@return void
Updates the details in the cart items table .