Skip to content

auditSync with multiple IDs #764

@protoapostoli

Description

@protoapostoli
Q A
Bug? yes
New Feature? no
Framework Laravel
Framework version 8.x.y
Package version 13
PHP version 8.1

Actual Behaviour

Empty audit values when using auditSync.

Expected Behaviour

I expected the system to loop through the resources to 'sync' all values from the relationship.

Steps to Reproduce

When I use auditSync('resources', $resources) it puts in a blank output into the DB. I have an array of IDs that I sync with. If I just pass one ID, it syncs fine, but if it's an array of IDs it turns up with blank values in the DB.

Here's my relationship.

    {
        return $this->belongsToMany(CalendarResource::class, 'bridge_events_resources')->withTimestamps();
    }

Possible Solutions

Possible solution, have the Auditing system loop through an array instead of just limiting it to one?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions