Home › Laravel › Laravel Livewire AGENTS.md

Laravel Livewire AGENTS.md

AGENTS.md for Livewire 3+ components in Laravel: properties, validation attributes, computed data, and Alpine.

AGENTS.mdLaravel

How to use

Save this as AGENTS.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

Note: Review and test before use. Provided as is, without warranty. See Terms.

AGENTS.mdDownload  
# AGENTS.md: Livewire components

## Commands
`php artisan make:livewire Orders/Index` · `php artisan test` · `./vendor/bin/pint`
- Check `composer.json` for the Livewire major version and follow its docs (v3 vs v4 differ in file layout).

## Component rules
- Public properties are sent to the browser and can be changed by the user. Never store secrets or trust them: lock ids with `#[Locked]`, and re-authorize in every action (`$this->authorize('update', $this->order)`).
- Validate with `#[Validate('required|email')]` on properties or a Form object (`Livewire\Form`), and call `$this->validate()` in actions.
- Derived data via `#[Computed]` methods (cached per request) instead of storing large collections in public properties.
- Pass models as properties (they're dehydrated to ids) instead of arrays of data.
- Inputs: `wire:model` (deferred) by default; `.live` with `.debounce.300ms` only for search-as-you-type.
- Loops use `wire:key` with a stable id on each item.
- Loading states with `wire:loading` and `wire:target`; disable buttons during submits.
- Small client interactions with Alpine (`x-data`, `$wire`) instead of extra round trips.
- Pagination with `WithPagination`; reset the page when filters change.
- Events between components with `$this->dispatch('order-saved')` and `#[On('order-saved')]`.

## Tests
`Livewire::test(Index::class)->set('search', 'x')->assertSee(...)`, plus authorization tests for every action.

More: all Laravel rules · all AGENTS.md rules

Related rules

Laravel Copilot instructions

GitHub Copilot instructions for Laravel 11+ apps with Eloquent, Pest, and Form Requests.

GitHub CopilotLaravel

Laravel 13 rules

Cursor rules for Laravel 13 apps on PHP 8.3+: Eloquent, Form Requests, policies, queues, Pest tests, and Pint.

CursorLaravel

REST API design AGENTS.md

AGENTS.md for designing consistent HTTP/JSON APIs: resource naming, status codes, errors, pagination, and versioning.

AGENTS.mdAPI design

Blazor (.NET 10) AGENTS.md

AGENTS.md for Blazor Web Apps on .NET 10: render modes, components, forms and validation, state, and bUnit tests.

AGENTS.md.NET / ASP.NET Core

Celery background jobs AGENTS.md

AGENTS.md for Celery 5 task queues in Python/Django: idempotent tasks, retries, time limits, and safe enqueueing.

AGENTS.mdPython

Deno 2 AGENTS.md

AGENTS.md for Deno 2 projects: deno.json tasks, JSR and npm imports, permissions, and built-in tooling.

AGENTS.mdDeno

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.