Livewire Patterns

Livewire component pattern'leri. Form, tablo, modal, arama. Livewire component yazarken kullan.

RadKod 8e3df51 981 B Updated

File contents

Form Component

class EditProfile extends Component
{
    #[Validate('required|string|max:255')]
    public string $name = '';

    #[Validate('required|email')]
    public string $email = '';

    public function mount(): void
    {
        $this->name = auth()->user()->name;
        $this->email = auth()->user()->email;
    }

    public function save(): void
    {
        $validated = $this->validate();
        auth()->user()->update($validated);
        $this->dispatch('profile-updated');
    }

    public function render(): View
    {
        return view('livewire.edit-profile');
    }
}

Arama + Debounce

<input wire:model.live.debounce.300ms="search" placeholder="Ara..." />

Lazy Loading

#[Lazy]
class HeavyTable extends Component { ... }
<livewire:heavy-table lazy />

RadKod/claude-agents-kit/tree/main/laravel/.claude/skills/livewire-patterns commit 8e3df514f0

Frequently asked questions

npx skillmds@latest add radkod/livewire-patterns