PHPackages                             leuverink/livewire-property-groups - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. leuverink/livewire-property-groups

ActiveLibrary

leuverink/livewire-property-groups
==================================

Livewire Attribute for grouping properties

2.0.0(5mo ago)12484MITPHPPHP ^8.1CI passing

Since Aug 26Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/gwleuverink/livewire-property-groups)[ Packagist](https://packagist.org/packages/leuverink/livewire-property-groups)[ RSS](/packages/leuverink-livewire-property-groups/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (9)Versions (10)Used By (0)

Livewire Property Groups
========================

[](#livewire-property-groups)

[![codestyle](https://github.com/gwleuverink/livewire-property-groups/actions/workflows/codestyle.yml/badge.svg)](https://github.com/gwleuverink/livewire-property-groups/actions/workflows/codestyle.yml)[![tests](https://github.com/gwleuverink/livewire-property-groups/actions/workflows/tests.yml/badge.svg)](https://github.com/gwleuverink/livewire-property-groups/actions/workflows/tests.yml)

This package simplifies property management, validation, and manipulation in Livewire components by allowing you to organize related properties into named groups.

Installation
------------

[](#installation)

```
composer require leuverink/livewire-property-groups
```

Basic Usage
-----------

[](#basic-usage)

```
use Leuverink\PropertyAttribute\Group;
use Leuverink\PropertyAttribute\WithGroups;

class Form extends Component
{
    use WithGroups;

    #[Group('a')]
    public $foo = 1;

    #[Group('a')]
    public $bar = 2;

    #[Group('b')]
    public $baz = 3;

    public function submit()
    {
        $this->group('a')->validate();

        //...
    }
}
```

### Accessing Group Properties

[](#accessing-group-properties)

Use the `WithGroups` trait within your Component or Form object to get access to the `group` method.

```
// Get all properties in a group
$this->group('a'); // ['foo' => 1, 'bar' => 2]

// Get property names
$this->group('a')->keys(); // ['foo', 'bar']

// Get property values
$this->group('a')->values(); // [1, 2]

// Iterate over properties
$this->group('a')->each(fn($value, $name) => /* */);

// Get all grouped properties, excluding non grouped
$this->group();

// Access a group as an array or an object
$this->group('a')['foo'];
$this->group('a')->foo;
```

### Proxying Livewire Methods

[](#proxying-livewire-methods)

```
// Reset properties to initial state
$this->group('a')->reset();

// Return all properties and reset to initial state
$this->group('a')->pull();

// Validate all properties in a group
$this->group('a')->validate();

// Works inside a form object
$this->userForm->group('a')->validate();
```

### Working with Multiple Groups

[](#working-with-multiple-groups)

```
// Retrieve properties from multiple groups
$this->group(['a', 'b']);

// Validate multiple groups
$this->group(['a', 'b'])->validate();
```

### Debugging

[](#debugging)

```
// dump group properties
$this->group('a')->dump();

// dd group properties
$this->group('a')->dd();

// dump is chainable
$validated = $this->group('a')
    ->dump()
    ->validate();
```

### Volt

[](#volt)

In class-based components, property groups work like any other Livewire component. When using Volt's functional API you may use property groups like demonstrated below.

```
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,
    'baz' => 'Lorem',
])->attribute(Group::class, 'b');

$action = action(function() {
    $groupA = $this->group('a')
        ->validate()
        ->values();

    $groupB = $this->group('b')
        ->validate()
        ->values();

    // ...
});
```

### Conflicting `group` method signature

[](#conflicting-group-method-signature)

I realize that `group` is a very generic method name that you might well use inside your own components. You may change the method signature by providing an alias.

```
use WithGroups {
    group as fooBar;
}
```

Development
-----------

[](#development)

```
composer lint # run all linters
composer fix # run all fixers

composer analyze # run static analysis
composer baseline # generate static analysis baseline
```

License
-------

[](#license)

This package is open-source software licensed under the MIT license.

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance74

Regular maintenance activity

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~63 days

Recently: every ~111 days

Total

8

Last Release

176d ago

Major Versions

1.4.1 → 2.0.02025-11-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/9531bf1fdbe178d3a5129b81e61b70be81359ebf10ce3f282705a8275b4bd31d?d=identicon)[gwleuverink](/maintainers/gwleuverink)

---

Top Contributors

[![gwleuverink](https://avatars.githubusercontent.com/u/17123491?v=4)](https://github.com/gwleuverink "gwleuverink (62 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/leuverink-livewire-property-groups/health.svg)

```
[![Health](https://phpackages.com/badges/leuverink-livewire-property-groups/health.svg)](https://phpackages.com/packages/leuverink-livewire-property-groups)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[power-components/livewire-powergrid

PowerGrid generates Advanced Datatables using Laravel Livewire.

1.7k1.7M6](/packages/power-components-livewire-powergrid)[livewire/flux

The official UI component library for Livewire.

9385.0M85](/packages/livewire-flux)[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[jantinnerezo/livewire-alert

This package provides a simple alert utilities for your livewire components.

8041.2M20](/packages/jantinnerezo-livewire-alert)[leandrocfe/filament-apex-charts

Apex Charts integration for Filament PHP.

4861.2M8](/packages/leandrocfe-filament-apex-charts)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
