laravel-tdd

Implement test-driven development workflows for Laravel applications using PHPUnit and Pest.

1|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/its-Basudeba/Care-HMS --skill laravel-tdd-its-basudeba
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-tdd
Source: https://github.com/its-Basudeba/Care-HMS/tree/main/.agent/skills/laravel-tdd
Command: npx skills add https://github.com/its-Basudeba/Care-HMS --skill laravel-tdd-its-basudeba

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the complexity of maintaining high-quality Laravel applications by providing a structured, repeatable approach to Test-Driven Development that ensures code reliability and prevents regressions.

Core Features & Use Cases

  • Test Layering: Provides clear guidance on implementing Unit, Feature, and Integration tests to cover business logic, HTTP endpoints, and database interactions.
  • Mocking & Fakes: Simplifies the testing of side effects like queues, mail, notifications, and external APIs using Laravel's built-in fakes.
  • Use Case: When developing a new API endpoint, use this workflow to write a failing Pest test, implement the controller logic, and verify the response structure and database state before deployment.

Quick Start

Use the laravel-tdd skill to generate a new feature test for the user registration endpoint using Pest.

Frequently Asked Questions about laravel-tdd

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

FAQPage Schema
How do I implement test-driven development in Laravel using Pest?

Laravel test-driven development with Pest is implemented by following the Red-Green-Refactor cycle to write failing feature tests, implement controller logic, and verify HTTP responses and database state before deployment.

What is the best way to structure Laravel tests for Eloquent models and HTTP layers?

Structuring Laravel tests requires layering unit, feature, and integration tests to isolate business logic, HTTP endpoints, and database interactions for comprehensive coverage and reliable code.

How do I test queues and external APIs in Laravel without triggering side effects?

Test queues and external APIs in Laravel without side effects by utilizing built-in fakes to mock mail, notifications, queues, and external API interactions during your testing workflows.

Can I use PHPUnit for integration testing Laravel database factories and policies?

PHPUnit supports integration testing in Laravel by leveraging database factories, fakes, and standardized testing practices to thoroughly test Eloquent models, policies, and HTTP layers.

When do I need to use database factories in Laravel TDD workflows?

Database factories are needed in Laravel TDD workflows to generate test data for verifying database state and interactions during the Red-Green-Refactor cycle of feature and integration tests.

Does the Laravel TDD workflow support setting test coverage targets?

The Laravel TDD workflow supports setting coverage targets to ensure high-quality code and prevent regressions by maintaining standardized testing practices across unit, feature, and integration tests.