Skip to content

Commit

Permalink
add volt to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed Oct 19, 2024
1 parent d0140d6 commit c978c28
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,32 @@ $validated = $this->group('a')

```

### Usage in Livewire Volt

```php
use Leuverink\PropertyAttribute\Group;
use Leuverink\PropertyAttribute\WithGroups;
use function Livewire\Volt\{action, state, uses};


uses([WithGroups::class]);

state([
'foo' => 1,
])->attribute(Group::class, 'a');

state([
'bar' => 2,
])->attribute(Group::class, 'b');

$action = action(function() {
$groupA = $this->group('a');
$groupB = $this->group('b');

// ...
});
```

### Conflicting `group` method signature

I realize that `group` is a very generic method name that you might well use inside your own components.
Expand Down

0 comments on commit c978c28

Please sign in to comment.