resources/boost/skills/livewire/SKILL.md
Laravel Livewire conventions for building interactive UI without custom JavaScript. Components are PHP classes with reactive properties, computed properties, and event dispatching.
npx skillsauth add codebar-ag/coding-guidelines livewireInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
livewire/livewire is installed and configured in the Laravel app.app/Livewire, resources/views/livewire).#[Computed] for derived values and avoid repeated query logic.wire:model.live or wire:model.lazy intentionally based on UX needs.namespace App\Livewire;
use App\Actions\CreateInvoice;
use App\Models\Invoice;
use Livewire\Attributes\Computed;
use Livewire\Component;
class InvoiceList extends Component
{
public string $search = '';
#[Computed]
public function invoices()
{
return Invoice::where('title', 'like', "%{$this->search}%")
->paginate(15);
}
public function delete(int $invoiceId): void
{
$invoice = Invoice::findOrFail($invoiceId);
$this->authorize('delete', $invoice);
$invoice->delete();
}
public function render()
{
return view('livewire.invoice-list');
}
}
{{-- Blade template — declarative, no logic --}}
<div>
<input wire:model.live="search" type="text" placeholder="Search invoices...">
@foreach ($this->invoices as $invoice)
<div>
{{ $invoice->title }}
<button wire:click="delete({{ $invoice->id }})">Delete</button>
</div>
@endforeach
{{ $this->invoices->links() }}
</div>
// Livewire Form Object for complex forms
use Livewire\Form;
class InvoiceForm extends Form
{
public string $title = '';
public int $order_id = 0;
public ?string $notes = null;
public function rules(): array
{
return [
'title' => ['required', 'string', 'max:255'],
'order_id' => ['required', 'integer', 'exists:orders,id'],
'notes' => ['nullable', 'string'],
];
}
}
// Cross-component event dispatching
$this->dispatch('invoice-created', invoiceId: $invoice->id);
// Listening for events
#[On('invoice-created')]
public function refreshList(int $invoiceId): void { ... }
wire:model without .live or .lazy when immediate reactivity is not needed (unnecessary requests)Blade/SKILL.md — Blade templates used by Livewire componentsActions/SKILL.md — Livewire components delegate business logic to Actionstesting
Translation and localization conventions for Laravel. Use when adding user-facing strings, creating translation files, or working with lang/ directory.
tools
Reusable behaviour shared across multiple unrelated classes. Traits provide shared Eloquent scopes, accessors, lifecycle hooks, and small stateless helper methods.
development
Tailwind CSS v4 styling conventions. Use when working with CSS, Tailwind utilities, or customizing the theme in Laravel projects.
development
Orchestration classes that coordinate multiple Actions, external APIs, or domain operations into a cohesive workflow. Services own transaction boundaries and third-party API integrations.