Skip to main content

volt-development

Develops single-file Livewire components with Volt. Activates when creating Volt components, converting Livewire to Volt, working with @volt directive, functional or class-based Volt APIs; or when the user mentions Volt, single-file components, functional Livewire, or inline component logic in Blade files.

소스 정보

저장소
shopperlabs/demo.laravelshopper.dev
최근 소스 활동
2026년 2월 19일 00:07
감지된 SKILL.md 언어
영어
스타
19
포크
6

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
volt-development
description
Develops single-file Livewire components with Volt. Activates when creating Volt components, converting Livewire to Volt, working with @volt directive, functional or class-based Volt APIs; or when the user mentions Volt, single-file components, functional Livewire, or inline component logic in Blade files.
license
MIT
metadata
{"author":"laravel"}
# Volt Development ## When to Apply Activate this skill when: - Creating Volt single-file components - Converting traditional Livewire components to Volt - Testing Volt components ## Documentation Use `search-docs` for detailed Volt patterns and documentation. ## Basic Usage Create components with `php artisan make:volt [name] [--test] [--pest]`. Important: Check existing Volt components to determine if they use functional or class-based style before creating new ones. ### Functional Components <!-- Volt Functional Component --> ```php @@volt <?php use function Livewire\Volt\{state, computed}; state(['count' => 0]); $increment = fn () => $this->count++; $double = computed(fn () => $this->count * 2); ?> <div> <h1>Count: @{{ $count }} (Double: @{{ $this->double }})</h1> <button wire:click="increment">+</button> </div> @@endvolt ``` ### Class-Based Components <!-- Volt Class-based Component --> ```php use Livewire\Volt\Component; new class extends Component { public int $count = 0; public function increment(): void { $this->count++; } } ?> <div> <h1>@{{ $count }}</h1> <button wire:click="increment">+</button> </div> ``` ## Testing Tests go in existing Volt test directory or `tests/Feature/Volt`: <!-- Volt Test Example --> ```php use Livewire\Volt\Volt; test('counter increments', function () { Volt::test('counter') ->assertSee('Count: 0') ->call('increment') ->assertSee('Count: 1'); }); ``` ## Verification 1. Check existing components for functional vs class-based style 2. Test component with `Volt::test()` ## Common Pitfalls - Not checking existing style (functional vs class-based) before creating - Forgetting `@volt` directive wrapper - Missing `--test` or `--pest` flag when tests are needed
GitHub에서 보기