Commit 471897d4 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix duplicate Alpine + broken entangle in setup wizard

1. app.js was importing and starting Alpine manually, but Livewire 3/4
   already bundles Alpine. Two instances meant $wire magic was unavailable.
   Now app.js just registers the focus plugin via Livewire's alpine:init hook.

2. Wizard x-data used @entangle which compiled to the old
   window.Livewire.find(id).entangle() syntax. Replaced with $wire getters
   which is the canonical Livewire 3+ approach.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent c32c7e5a
import Alpine from 'alpinejs';
import focus from '@alpinejs/focus'; import focus from '@alpinejs/focus';
Alpine.plugin(focus); document.addEventListener('livewire:init', () => {
window.Alpine = Alpine; Livewire.hook('alpine:init', ({ Alpine }) => {
Alpine.start(); Alpine.plugin(focus);
});
});
<div x-data="{ <div x-data="{
currentStep: @entangle('currentStep'), get currentStep() { return $wire.currentStep },
totalSteps: @entangle('totalSteps'), get totalSteps() { return $wire.totalSteps },
animating: false, animating: false,
direction: 'forward' direction: 'forward'
}" class="space-y-8"> }" class="space-y-8">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment