Skip to content

Properties

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

Template access

In the PHTML, the component instance is available as $magewire. Always escape output with Magento's $escaper:

view/frontend/templates/magewire/counter.phtml
<div>
    <?= $escaper->escapeHtml($magewire->label) ?>: <?= (int) $magewire->count ?>
</div>

Supported types

In addition to the Livewire defaults, Magewire supports \Magento\Framework\DataObject out of the box (serialised via getData()). Custom value objects require a synthesizer.

wire:model defaults to deferred

Migrating from Magewire V1

V1's wire:model was live-by-default and .lazy meant blur. V3 flips the default — wire:model defers. Use .live for instant sync. See Upgrade.