prototype
MAmattpocock/skills288k近 7 天新增 10,178 个 star
Build Livewire 4 components and applications. Use when creating reactive Laravel interfaces, single-file components, multi-file components, page components, forms, actions, or any Livewire-based UI. Triggers include "Livewire component", "wire:model", "wire:click", building interactive Laravel UIs, or working with Livewire 4 projects.
Build dynamic, reactive interfaces with PHP — no JavaScript required.
<?php // resources/views/components/⚡todos.blade.php
use Livewire\Component;
new class extends Component {
public $todos = [];
public $todo = '';
public function add()
{
$this->todos[] = $this->todo;
$this->reset('todo');
}
};
?>
<div>
<input type="text" wire:model="todo">
<button wire:click="add">Add</button>
@foreach ($todos as $item)
<li wire:key="{{ $loop->index }}">{{ $item }}</li>
@endforeach
</div>
php artisan make:livewire post.create --mfc
Creates: resources/views/components/post/⚡create/ with separate .php, .blade.php, .js, .css files.
php artisan make:livewire pages::post.create
Route with: Route::livewire('/posts/create', 'pages::post.create');
$this->reset('prop') to reset$this->fill([...]) for bulk assignment<input wire:model="title"> <!-- Syncs on action -->
<input wire:model.live="search"> <!-- Syncs on input -->
<input wire:model.blur="email"> <!-- Syncs on blur -->
<button wire:click="save">Save</button>
<button wire:click="delete({{ $id }})">Delete</button>
<form wire:submit="store">...</form>
use Livewire\Attributes\Computed;
#[Computed]
public function posts()
{
return Post::latest()->get();
}
Access in Blade: $this->posts
wire:click.prevent - preventDefaultwire:keydown.enter - specific keywire:click.debounce.500ms - debouncewire:submit.throttle - throttle<button wire:click="save" class="data-loading:opacity-50">
Save
</button>
<span class="not-data-loading:hidden">Saving...</span>
<button wire:click="delete" wire:confirm="Are you sure?">Delete</button>
Always validate and authorize — public properties can be manipulated client-side.
public function delete(Post $post)
{
$this->authorize('delete', $post);
$post->delete();
}
Load these as needed:
references/components.mdreferences/properties.mdreferences/actions.mdMAmattpocock/skills288k近 7 天新增 10,178 个 star
AFaffaan-m/ECC278k近 7 天新增 4,046 个 star
FIfirecrawl/firecrawl191k近 7 天新增 2,010 个 star
用 React、Tailwind 和 shadcn/ui 构建多组件页面。
ANanthropics/skills181k近 7 天新增 1,119 个 star