0027-laravel-controller-tests

Assert Laravel controller HTTP responses for validation failures and empty fields.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/MrJmpl3/codex_____data_____configuration --skill 0027-laravel-controller-tests
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: 0027-laravel-controller-tests
Source: https://github.com/MrJmpl3/codex_____data_____configuration/tree/main/skills/0027-laravel-controller-tests
Command: npx skills add https://github.com/MrJmpl3/codex_____data_____configuration --skill 0027-laravel-controller-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you verify Laravel controller behavior reliably without turning tests into slow, brittle duplicates of the application logic.

Core Features & Use Cases

  • HTTP-focused assertions: Validate endpoint responses such as validation errors using Laravel HTTP test helpers.
  • Separation of concerns: Keep heavy logic in Actions/Services and unit test those components directly.
  • Maintainable test strategy: Prefer Form Requests for validation rules and assert errors coming from the request layer, using factories for realistic data.

Quick Start

Ask the AI to propose a set of Laravel controller (feature) tests that assert validation errors via Form Requests and keep business rules tested in Actions or Services.

Frequently Asked Questions about 0027-laravel-controller-tests

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

FAQPage Schema
How do I test Laravel controller validation errors without duplicating application logic?▼

Laravel controller tests should assert HTTP responses for specific input conditions using Form Requests to produce validation errors. This keeps tests fast and focused on endpoint behavior rather than mirroring business logic.

What is the best way to structure Laravel feature tests for registration routes?▼

The best way to structure Laravel feature tests is to assert HTTP responses at the endpoint level while moving heavy logic into Actions or Services for direct unit testing. This ensures deterministic HTTP assertions.

Do I need Form Requests to test validation failures in Laravel controllers?▼

Yes, you need Form Requests to test validation failures in Laravel controllers. The Skill leverages Form Requests for validation error production and asserts those errors coming from the request layer.

Can I use Actions and Services to keep my Laravel controller tests maintainable?▼

Yes, you can use Actions and Services to keep Laravel controller tests maintainable. The Skill encourages moving heavy logic into Actions or Services for direct unit testing, leaving controllers thin.

Why does my Laravel controller test keep failing on empty fields?▼

Laravel controller tests fail on empty fields when validation rules are not properly asserted. The Skill applies deterministic HTTP assertions to verify endpoint responses for specific input conditions like empty fields.