maarheeze/uuid-livewire

livewire integration for a simple uuid value object
162
Install
composer require maarheeze/uuid-livewire
Latest Version:3.0.1
PHP:^8.4
License:MIT
Last Updated:Sep 4, 2026
Links: GitHub  ·  Packagist
Maintainer: wietsewarendorff

maarheeze/uuid-livewire

Livewire integration for maarheeze/uuid.

Livewire serializes component properties between requests. Without this package, it does not know how to handle Uuid value objects and will fail when one is used as a property. This package registers a property synthesizer that teaches Livewire how to serialize and deserialize Uuid instances automatically.

Installation

composer require maarheeze/uuid-livewire

Usage

Custom Livewire components

Declare a Uuid property directly — no manual conversion needed.

use Livewire\Component;
use Maarheeze\Uuid\Uuid;

class ShowArticle extends Component
{
    public Uuid $articleId;
}

Typed identifiers

Typed identifiers — your own classes using the IsUuid trait — are supported the same way, and keep their own type across requests. A PlayerId property hydrates back as a PlayerId, never as a plain Uuid.

use Livewire\Component;
use App\Player\PlayerId;

class ShowPlayer extends Component
{
    public PlayerId $playerId;
}

This also covers properties updated from the browser, such as wire:model bindings and url parameters.

Filament

Filament pages are Livewire components. When a Filament resource uses a Uuid as its primary key, Livewire needs to serialize it between requests — for example, when loading an edit page. Without this package, Filament will fail to keep track of the record.

use Filament\Resources\Resource;
use App\Models\Article; // model with a Uuid primary key

class ArticleResource extends Resource
{
    protected static string $model = Article::class;
}

No additional configuration is required in either case — installing this package is enough.

License

MIT

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

634,760,849 9,707
laravel/framework

The Laravel Framework.

584,532,650 34,931
laravel/tinker

Powerful REPL for the Laravel framework.

493,838,477 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

408,553,772 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

387,976,821 4,658