PHPackages                             bastinald/laravel-livewire-model - 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. bastinald/laravel-livewire-model

ActiveLibrary

bastinald/laravel-livewire-model
================================

Laravel Livewire form data modelling trait.

2.0.2(4y ago)161MITPHP

Since Aug 31Pushed 4y ago1 watchersCompare

[ Source](https://github.com/bastinald/laravel-livewire-model)[ Packagist](https://packagist.org/packages/bastinald/laravel-livewire-model)[ Docs](https://github.com/bastinald/laravel-livewire-model)[ RSS](/packages/bastinald-laravel-livewire-model/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

Laravel Livewire Model
======================

[](#laravel-livewire-model)

This package contains a trait which makes Laravel Livewire form data model manipulation a breeze. No more having to create a Livewire component property for every single form input. All form data will be placed inside the `$model` property array.

Documentation
-------------

[](#documentation)

- [Installation](#installation)
- [Usage](#usage)
    - [The WithModel Trait](#the-withmodel-trait)
    - [Getting Model Data](#getting-model-data)
    - [Setting Model Data](#setting-model-data)
    - [Binding Model Data](#binding-model-data)
    - [Validating Model Data](#validating-model-data)

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

[](#installation)

Require the package via composer:

```
composer require bastinald/laravel-livewire-model
```

Usage
-----

[](#usage)

### The WithModel Trait

[](#the-withmodel-trait)

Add the `WithModel` trait to your Livewire components:

```
class Login extends Component
{
    use WithModel;

    //
}
```

### Getting Model Data

[](#getting-model-data)

Get all model data as an array:

```
$array = $this->getModel();
```

Get a single value:

```
$email = $this->getModel('email');
```

Get an array of specific values:

```
$credentials = $this->getModel(['email', 'password']);
```

### Setting Model Data

[](#setting-model-data)

Set a single value:

```
$this->setModel('name', 'Kevin');
```

Set values using an array:

```
$this->setModel([
    'name' => 'Kevin',
    'email' => 'kevin@example.com',
]);
```

Set values using Eloquent model data:

```
$this->setModel(User::first());
```

### Binding Model Data

[](#binding-model-data)

Just prepend your `wire:model` attribute with `model.`:

```

```

### Validating Model Data

[](#validating-model-data)

Use the `validateModel` method to validate model data:

```
$this->validateModel([
    'name' => ['required'],
    'email' => ['required', 'email'],
]);
```

This method works just like the Livewire `validate` method, so you can specify your rules in a separate `rules` method if you prefer.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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 ~0 days

Total

3

Last Release

1713d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/82109804?v=4)[bastinald](/maintainers/bastinald)[@bastinald](https://github.com/bastinald)

---

Top Contributors

[![bastinald](https://avatars.githubusercontent.com/u/82109804?v=4)](https://github.com/bastinald "bastinald (5 commits)")

### Embed Badge

![Health badge](/badges/bastinald-laravel-livewire-model/health.svg)

```
[![Health](https://phpackages.com/badges/bastinald-laravel-livewire-model/health.svg)](https://phpackages.com/packages/bastinald-laravel-livewire-model)
```

###  Alternatives

[livewire/volt

An elegantly crafted functional API for Laravel Livewire.

4195.3M84](/packages/livewire-volt)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[mhmiton/laravel-modules-livewire

Using Laravel Livewire in Laravel Modules package with automatically registered livewire components for every modules.

236409.6k9](/packages/mhmiton-laravel-modules-livewire)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)[lakm/laravel-comments

Integrate seamless commenting functionality into your Laravel project.

40012.9k1](/packages/lakm-laravel-comments)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

2381.5k10](/packages/marcorieser-statamic-livewire)

PHPackages © 2026

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