laravel-tdd

Guide test-driven development in Laravel with PHPUnit and Pest.

3|2|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/agentmatters/mullai-bot --skill laravel-tdd-agentmatters
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-tdd
Source: https://github.com/agentmatters/mullai-bot/tree/main/src/Mullai.Skills/Skills/claude-code-everything/laravel-tdd
Command: npx skills add https://github.com/agentmatters/mullai-bot --skill laravel-tdd-agentmatters

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel projects often face inconsistent testing practices, slow feedback loops, and difficulty coordinating unit, feature, and database tests. This Skill provides a clear TDD workflow for Laravel using PHPUnit and Pest, with guidance on using factories, database strategies, and test doubles to accelerate reliable tests.

Core Features & Use Cases

  • Structured TDD workflow for Laravel applications, covering unit, feature, and integration tests using PHPUnit and Pest.
  • Guidance on database strategies including RefreshDatabase, DatabaseTransactions, and DatabaseMigrations to ensure fast, isolated tests.
  • Best practices for using factories and fakes to create deterministic, repeatable test data and high test coverage.

Quick Start

Start by creating a failing test with Pest or PHPUnit, then implement the minimal code to pass, and finally refactor for maintainability.

Frequently Asked Questions about laravel-tdd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I start test-driven development in Laravel using PHPUnit and Pest?

To start test-driven development in Laravel, create a failing test with Pest or PHPUnit, implement the minimal code required to pass the test, and finally refactor the code for maintainability.

What's the best database testing strategy for Laravel feature tests?

The best database testing strategy depends on your suite size: use RefreshDatabase for isolated integration tests, DatabaseTransactions for fast feature tests, and DatabaseMigrations when you need schema-level isolation.

How do factories and fakes work in Laravel database testing?

Factories and fakes work in Laravel database testing by generating deterministic, repeatable test data and replacing external dependencies, ensuring your unit and feature tests remain fast and reliable.

Can I test Laravel jobs, policies, and controllers with Pest?

Yes, you can test Laravel jobs, policies, and controllers with Pest by following a structured TDD workflow that covers unit, feature, and integration testing across all core application components.

Why are my Laravel database tests running so slowly?

Laravel database tests run slowly when not using proper database strategies or test doubles; implementing RefreshDatabase, DatabaseTransactions, and fakes for external interactions accelerates feedback loops.