You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{-- In Blade template --}}
<inputtype="text"wire:model="title">
{{-- Live updates (debounced) --}}
<inputtype="text"wire:model.live="search">
{{-- On blur --}}
<inputtype="text"wire:model.blur="email">
{{-- Debounce with custom delay --}}
<inputtype="text"wire:model.live.debounce.500ms="search">
Nested Form Binding
{{-- With form object --}}
<inputtype="email"wire:model="form.email">
<inputtype="password"wire:model="form.password">
<inputtype="checkbox"wire:model="form.remember">
<buttonwire:click="delete({{$ticket->id}})"wire:confirm="Are you sure you want to delete this ticket?">
Delete
</button>
Events
Dispatching Events
// From component$this->dispatch('ticket-created');
// With data$this->dispatch('ticket-updated', ticketId: $ticket->id);
// To specific component$this->dispatch('refresh')->to(TicketList::class);
// To parent$this->dispatch('saved')->up();
// Standard redirectreturnredirect()->route('dashboard');
// With SPA navigation$this->redirect(route('dashboard'), navigate: true);
// With flash messagesession()->flash('message', 'Ticket created successfully.');
$this->redirect(route('tickets.index'), navigate: true);
SPA Links in Blade
{{-- Use wire:navigate for SPA-style navigation --}}
<ahref="{{route('dashboard') }}"wire:navigate>Dashboard</a>
{{-- Prefetch on hover --}}
<ahref="{{route('tickets.show', $ticket) }}"wire:navigate.hover>
{{$ticket->title}}
</a>
Loading States
{{-- Loading indicator --}}
<buttonwire:click="save">
<spanwire:loading.removewire:target="save">Save</span>
<spanwire:loadingwire:target="save">Saving...</span>
</button>
{{-- Disable during loading --}}
<buttonwire:click="save"wire:loading.attr="disabled">
Save
</button>
{{-- Loading class --}}
<divwire:loading.class="opacity-50"wire:target="save">
Content
</div>