Skip to content

Hydration

Laravel Livewire Documentation Reference

Since Magewire is heavily inspired by Laravel Livewire, many concepts are either identical or very similar. To avoid duplicating documentation, this page only covers Magewire-specific and platform-specific details. For all general concepts and in-depth explanations, you can refer to the corresponding Laravel Livewire documentation.

Livewire Reference

Update endpoint

Magewire posts snapshots to /magewire/update. The checksum is an HMAC signed with the Magento crypt key (app/etc/env.phpcrypt/key).

Built-in synthesizers

Magewire adds a \Magento\Framework\DataObject synthesizer on top of the default scalars, arrays, \stdClass, and backed enums. Custom types require a synthesizer registered in etc/frontend/di.xml. See Synthesizers.

Hydration hooks

Re-resolve non-serialisable Magento dependencies after a property is restored:

public int $productId = 0;

private ?ProductInterface $product = null;

public function hydrateProductId(int $value): void
{
    $this->product = $this->productRepository->getById($value);
}