Agent skill
laravel-validation
Form request validation and comprehensive validation testing. Use when working with validation rules, form requests, validation testing, or when user mentions validation, form requests, validation rules, conditional validation, validation testing.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/laravel-validation
SKILL.md
Laravel Validation
Form requests as single source of truth for validation, with comprehensive testing patterns.
Core Concepts
form-requests.md - Validation rules:
- Array-based validation rules
- Custom validation rules
- Conditional validation
- Custom error messages
- DTO transformation via
toDto()
validation-testing.md - Validation testing:
- RequestDataProviderItem helper
- Pest datasets for systematic testing
- Built-in helper methods (string, email, number, date, array, boolean)
- Nested array testing
- Conditional validation testing
- Real-world examples
Pattern
final class CreateOrderRequest extends FormRequest
{
public function rules(): array
{
return [
'user_id' => ['required', 'integer', 'exists:users,id'],
'items' => ['required', 'array', 'min:1'],
'items.*.product_id' => ['required', 'integer'],
'items.*.quantity' => ['required', 'integer', 'min:1'],
];
}
public function toDto(): CreateOrderDto
{
return CreateOrderDto::from($this->validated());
}
}
All validation lives in form requests. Test validation systematically.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?