Skip to content

Cart Update merge groups & roles #176

@devskio

Description

@devskio

Bug description

When we try to update cart with logged in user and submits customer data PATCH /!/cargo/cart HTTP/2 fails with a following error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'roles' in 'SET' (Connection: mariadb, Host: db, Port: 3306, Database: db, SQL: update `users` set `first_name` = Peter, `roles` = [\"customer\"], `groups` = [\"customer\"], `users`.`updated_at` = 2026-04-20 12:24:30 where `id` = 1)

Problem lays here where merge() writes that merged array back via set() for each key, including roles/groups, so Eloquent tries to update users.roles and users.groups columns.

How to reproduce

Send request to PATCH /!/cargo/cart HTTP/2 with some customer data eg customer[name] or so

Logs

Environment

Environment
Laravel Version: 13.5.0
PHP Version: 8.4.17
Composer Version: 2.9.5
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: NOT CACHED

Drivers
Broadcasting: log
Cache: redis
Database: mariadb
Logs: stack / single
Mail: smtp
Queue: redis
Session: redis

Storage
public/storage: NOT LINKED

Statamic
Addons: 3
Sites: 2 (AdWise DE, AdWise EN)
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.14.0 PRO

Statamic Addons
duncanmcclean/statamic-cargo: 1.3.2
jacksleight/statamic-bard-texstyle: 4.1.0
mitydigital/sitemapamic: 3.5.0

Cargo
Carts: file
Orders: file

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions