Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

livewire-development

/livewire-development

Obsługuje każde zadanie z Livewire: buduje komponenty, debuguje reaktywność, dodaje walidację formularzy w czasie rzeczywistym i stany ładowania, migruje z wersji 2 do 3 i optymalizuje wydajność.

Repozytorium
coolify ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
27.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
5
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co sprawdzić przed instalacją
  • SKILL.md zawiera komentarze HTML (5). Nie widać ich w podglądzie Markdown, a model je czyta.

Co robi i kiedy

Obsługuje każde zadanie z Livewire: buduje komponenty, debuguje reaktywność, dodaje walidację formularzy w czasie rzeczywistym i stany ładowania, migruje z wersji 2 do 3 i optymalizuje wydajność.

Oryginalny opis (EN)

Use for any task or question involving Livewire. Activate if user mentions Livewire, wire: directives, or Livewire-specific concepts like wire:model, wire:click, invoke this skill. Covers building new components, debugging reactivity issues, real-time form validation, loading states, migrating from Livewire 2 to 3, converting component formats (SFC/MFC/class-based), and performance optimization. Do not use for non-Livewire reactive UI (React, Vue, Alpine-only, Inertia.js) or standard Laravel forms without Livewire.

Jak działa

  1. Documentation
  2. Basic Usage
  3. Livewire 3 Specifics
  4. Best Practices
  5. JavaScript Hooks
  6. Testing
  7. Common Pitfalls
Sekcje z nagłówków SKILL.md, w oryginale · 112 linii, 411 słów
Podgląd SKILL.md
---
name: livewire-development
description: "Use for any task or question involving Livewire. Activate if user mentions Livewire, wire: directives, or Livewire-specific concepts like wire:model, wire:click, invoke this skill. Covers building new components, debugging reactivity issues, real-time form validation, loading states, migrating from Livewire 2 to 3, converting component formats (SFC/MFC/class-based), and performance optimization. Do not use for non-Livewire reactive UI (React, Vue, Alpine-only, Inertia.js) or standard Laravel forms without Livewire."
license: MIT
metadata:
  author: laravel
---

# Livewire Development

## Documentation

Use `search-docs` for detailed Livewire 3 patterns and documentation.

## Basic Usage

### Creating Components

Use the `php artisan make:livewire [Posts\CreatePost]` Artisan command to create new components.

### Fundamental Concepts

- State should live on the server, with the UI reflecting it.
- All Livewire requests hit the Laravel backend; they're like regular HTTP requests. Always validate form data and run authorization checks in Livewire actions.

## Livewire 3 Specifics

### Key Changes From Livewire 2

These things changed in Livewire 3, but may not have been updated in this application. Verify this application's setup to ensure you follow existing conventions.
- Use `wire:model.live` for real-time updates, `wire:model` is now deferred by default.
- Components now use the `App\Livewire` namespace (not `App\Http\Livewire`).
- Use `$this->dispatch()` to dispatch events (not `emit` or `dispatchBrowserEvent`).
- Use the `components.layouts.app` view as the typical layout path (not `layouts.app`).

### New Directives

- `wire:show`, `wire:transition`, `wire:cloak`, `wire:offline`, `wire:target` are available for use.

### Alpine Integration

- Alpine is now included with Livewire; don't manually include Alpine.js.
- Plugins included with Alpine: persist, intersect, collapse, and focus.

## Best Practices

### Component Structure

- Livewire components require a single root element.
- Use `wire:loading` and `wire:dirty` for delightful loading states.

### Using Keys in Loops

<!-- Wire Key in Loops -->
```blade
@foreach ($items as $item)
    <div wire:key="item-{{ $item->id }}">
        {{ $item->name }}
    </div>
@endforeach
```

### Lifecycle Hooks

Prefer lifecycle hooks like `mount()`, `updatedFoo()` for initialization and reactive side effects:

<!-- Lifecycle Hook Examples -->
```php
public function mount(User $user) { $this->user = $user; }
public function updatedSearch() { $this->resetPage(); }
```

## JavaScript Hooks

You can listen for `livewire:init` to hook into Livewire initialization:

<!-- Livewire Init Hook Example -->
```js
document.addEventListener('livewire:init', function () {
    Livewire.hook('request', ({ fail }) => {
        fail(({ status, preventDefault }) => {
            if (status === 419) {
                preventDefault();
                alert('Your session expired');
            }
        });
    });

    Livewire.hook('commit', ({ fail }) => {
        fail(() => console.error('Livewire commit failed'));
    });
});
```

## Testing

<!-- Example Livewire Component Test -->
```php
Livewire::test(Counter::class)
    ->assertSet('count', 0)
    ->call('increment')
    ->assertSet('count', 1)
    ->assertSee(1)
    ->assertStatus(200);
```

<!-- Testing Livewire Component Exists on Page -->
```php
$this->get('/posts/create')
    ->assertSeeLivewire(CreatePost::class);
```

## Common Pitfalls

- Forgetting `wire:key` in loops causes unexpected behavior when items change
- Using `wire:model` expecting real-time updates (use `wire:model.live` instead in v3)
- Not validating/authorizing in Livewire actions (treat them like HTTP requests)
- Including Alpine.js separately when it's already bundled with Livewire 3

Wersje

RepozytoriumWynikLicencja
Ta strona · coollabsio/coolify100Apache-2.0
spatie/freek.dev100MIT
diegovilo/espocrm-client-portal100MIT

Identyczna treść występuje jeszcze w 2 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.

Migawka bazy z 13.11.2026 · wersja paczki 6f200bd2794d (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100laravel-livewire
    Buduje reaktywne komponenty Livewire 4 w Laravel 13 (wire:model, akcje, zdarzenia, Volt, Folio), tworząc interfejs reaktywny bez własnego JavaScriptu.
  • 100frontend-patterns
    Podaje wzorce budowy interfejsu w Livewire, Blade i Alpine w aplikacji Laravel: kompozycja komponentów, umiejscowienie stanu, wydajność, formularze i stany ładowania, pustki oraz błędu.
  • 90livewire
    Obsługuje frontend oparty na Livewire: stan reaktywny, zdarzenia, hooki cyklu życia i rozdział komponentów od widoków.
  • 82livewire-flux
    Generuje komponenty Livewire 4 z Flux UI dla Laravel: formularze, tabele, modale, powiadomienia, wysyłkę plików i role w UI.
  • 90flux
    Obsługuje projekty używające livewire/flux, uruchamiane z dyrektyw ui/apply, review i polish: komponenty Flux, sloty, warianty i podstawowe elementy formularzy.
  • 100laravel-specialist
    Buduje i konfiguruje aplikacje Laravel 10+: modele, relacje, Sanctum, Horizon, API i komponenty Livewire oraz testy.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.