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';
Alpine.plugin(focus);
window.Alpine = Alpine;
Alpine.start();
document.addEventListener('livewire:init', () => {
Livewire.hook('alpine:init', ({ Alpine }) => {
Alpine.plugin(focus);
});
});
<div x-data="{
currentStep: @entangle('currentStep'),
totalSteps: @entangle('totalSteps'),
get currentStep() { return $wire.currentStep },
get totalSteps() { return $wire.totalSteps },
animating: false,
direction: 'forward'
}" 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