laravel-tdd
Test-driven development for Laravel with PHPUnit and Pest, factories, database testing, fakes, and coverage targets.
npx skills add mturac/everything-openai-codex --skill laravel-tdd --agent codex
Same command for any agent — swap --agent for claude-code, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Laravel TDD Workflow Test-driven development for Laravel applications using PHPUnit and Pest with 80%+ coverage (unit + feature). ## When to Use - New features or endpoints in Laravel - Bug fixes or refactors - Testing Eloquent models, policies, jobs, and notifications - Prefer Pest for new tests unless the project already standardizes on PHPUnit ## How It Works ### Red-Green-Refactor Cycle 1) Write a failing test 2) Implement the minimal change to pass 3) Refactor while keeping tests green ### Test Layers - **Unit**: pure PHP classes, value objects, services - **Feature**: HTTP endpoints, auth, validation, policies - **Integration**: database + queue + external boundaries Choose layers based on scope: - Use **Unit** tests for pure business logic and services. - Use **Feature** tests for HTTP, auth, validation, and response shape. - Use **Integration** tests when validating DB/queues/external services together. ### Database Strategy - `RefreshDatabase` for most feature/integration tests (runs migrations once per test run, then wraps each test in a transaction when supported; in-memory databases may re-migrate per test) - `DatabaseTransactions` when the schema is already migrated
- When to Use
- How It Works
- Red-Green-Refactor Cycle
- Test Layers
- Database Strategy
- Testing Framework Choice
- Examples
- PHPUnit Example
- Feature Test Example (HTTP Layer)
- Pest Example
- Feature Test Pest Example (HTTP Layer)
- Factories and States
- Database Testing
- Persistence Test Example
What does the laravel-tdd skill do?
Test-driven development for Laravel with PHPUnit and Pest, factories, database testing, fakes, and coverage targets.
How do I install it?
Run `npx skills add mturac/everything-openai-codex --skill laravel-tdd --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From mturac/everything-openai-codex, a repository with 84 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
