livewire / livewire/volt

Updated hook not triggered on array property

Open
#107 0 comments 0 reactions 1 assignee View on GitHub

@nunomaduro is already working on this.

Since Jun 25, 2024.

needs more info
Dominant language
PHP
Stars
423
Forks
36
PR merge metrics
No merged PRs in 30d

Description

### Volt Version

1.6.3

### Laravel Version

11.7.0

### PHP Version

8.3.8

### Database Driver & Version

Not applicable

### Description

```php
updated([
'profiles' => function () {
// Not triggered
},
'profiles.0' => function () {
// Triggered when key 0 changed
}
]);
```

```blade
@foreach(Profile::cases() as $profile)

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.