maarheeze/uuid-livewire
| Install | |
|---|---|
composer require maarheeze/uuid-livewire |
|
| Latest Version: | 3.0.1 |
| PHP: | ^8.4 |
| License: | MIT |
| Last Updated: | Sep 4, 2026 |
| Links: | GitHub · Packagist |
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
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.