Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated hook not triggered on array property #107

Open
undjike opened this issue Jun 25, 2024 · 0 comments
Open

Updated hook not triggered on array property #107

undjike opened this issue Jun 25, 2024 · 0 comments
Assignees

Comments

@undjike
Copy link

undjike commented Jun 25, 2024

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).

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

No branches or pull requests

3 participants