/laravel-team:laravel-testingfrom Laravel Guild
Provides recipes for Laravel testing with Pest/PHPUnit: fakes with assertion syntax, factory states, time control, DB strategies. Use when writing or reviewing tests.
Ships in Laravel Guild. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Match the project first: Pest vs PHPUnit from composer.json, DB strategy from existing tests (RefreshDatabase — transaction-based, skips migrating when the schema is current — vs DatabaseMigrations / DatabaseTruncation, both slower full resets needed for browser tests). Seeding: prefer L13's #[Seed] / #[Seeder(OrderStatusSeeder::class)] attributes over manual $this->seed() boilerplate; #[UnitTest] on a pure-logic method skips booting the app for just that test. Never introduce a second runner or strategy.
Fake the framework primitive, assert the interaction. Never mock what Laravel fakes.
| Primitive | Setup | Assert |
|---|---|---|
Mail::fake() | Mail::assertSent(OrderShipped::class, fn ($m) => $m->hasTo($user->email)) · assertQueued · assertNothingSent | |
| Notification | Notification::fake() | Notification::assertSentTo($user, InvoicePaid::class, fn ($n, $channels) => in_array('mail', $channels)) |
| Queue / Bus | Queue::fake() / Bus::fake() | Bus::assertDispatched(ProcessOrder::class, fn ($job) => $job->order->is($order)) · assertChained · assertBatched · assertNotDispatched |
| Event | Event::fake([OrderShipped::class]) | Event::assertDispatched(OrderShipped::class) — always pass the allowlist: a bare Event::fake() suppresses model events and factories break silently |
| HTTP | Http::fake(['api.stripe.com/*' => Http::response(['id' => 'ch_1'], 200)]) | Http::assertSent(fn (Request $r) => $r->url() === … && $r['amount'] === 500). Fake success, 4xx, 5xx, and Http::failedConnection() timeout |
| Storage | Storage::fake('avatars') | Storage::disk('avatars')->assertExists($path) · assertMissing |
| Process | Process::fake(['git *' => Process::result('ok')]) | Process::assertRan(fn ($p) => str_contains($p->command, 'git')) |
Jobs: Bus::fake() proves dispatch; invoking $job->handle() directly proves effect. Test both, plus failed().
$this->travelTo(now()->addDays(30)), $this->freezeTime(), $this->travelBack(). Any TTL, expiry, or scheduling logic gets a time-travel test — never sleep().
OrderFactory::new()->paid()->forUser($user). Never hand-build models in tests.Sequence for controlled variation: ->state(new Sequence(['status' => 'active'], ['status' => 'churned'])).->has(Post::factory()->count(3)) / ->for($team). recycle($tenant) to share one parent across the tree — the multi-tenant test essential.Model::factory()->make()->getAttributes() for validation-payload arrays (doc-backed; ->raw() exists but is undocumented).Detect first, then match: pestphp/pest-plugin-browser (Pest v4 — current) vs laravel/dusk (legacy — keep, don't migrate mid-PR).
Pest v4: visit('/dashboard')->assertSee(…), plus free checks Dusk lacks — assertNoJavascriptErrors(), assertNoConsoleLogs(), assertNoAccessibilityIssues(). Use them on every page test.
Livewire::test(CreateOrder::class)->set('email', '[email protected]')->call('save')->assertHasNoErrors()->assertDispatched('order-created').$this->get(route('orders.index'))->assertInertia(fn (Assert $page) => $page->component('Orders/Index')->has('orders', 3)).livewire(CreateOrder::class)->fillForm([...])->call('create')->assertNotified().assertJsonValidationErrors (APIs) or assertInvalid / assertRedirectBackWithErrors (classic web forms).assertJsonPath, assertJsonStructure), and DB state (assertDatabaseHas, assertDatabaseCount).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
laravel-testing, pest, phpunit, fakes, factories, browser-testing
8 skills in this plugin
/accessibility-designThe WCAG 2.2 AA audit cookbook for Laravel front-ends and mobile — concrete thresholds (contrast, target size, focus), Livewire / Inertia focus-management specifics, screen-reader semantics, reduced motion, mobile a11y (VoiceOver / TalkBack, dynamic type). Use when designing screens, auditing UI for accessibility, or reviewing frontend / mobile work for the accessibility part of done./delivery-templatesArtifact templates for the planning + coordination roles — requirements doc, user story + acceptance criteria, RICE / WSJF scoring, sprint plan, retro, team-health report, stakeholder update, delivery log. Use when producing any docs/requirements, docs/backlog, docs/roadmap, or docs/sprints artifact, so every document lands in the same shape at the expected path./npx claudepluginhub hamzaalayed/laravel-claude-agents --plugin laravel-teamOther plugins' skills for the same job