Skip to content

Updated hook not triggered on array property #107

Description

@undjike

Volt Version

1.6.3

Laravel Version

11.7.0

PHP Version

8.3.8

Database Driver & Version

Not applicable

Description

updated([
    'profiles' => function () {
        // Not triggered
    },
    'profiles.0' => function () {
        // Triggered when key 0 changed
    }
]);
@foreach(Profile::cases() as $profile)
      <input type="checkbox"
                  wire:model.live="profiles"
                  value="{{ $profile->name }}"
                  class="sr-only peer"
                  id="user-assigned-{{ $profile->name }}">
@endforeach

The problem is there could be several keys in the array and I don't know which might change. I want to track any changes on the array an execute an action.

Steps To Reproduce

Create a Volt component an listen to the updated hook on an array property (wired to a checkbox in this case).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions