Files
KanbanGit/.agents/skills/project-request-validation-style/SKILL.md
Twyco 73cee8178f
linter / quality (pull_request) Successful in 2m28s
tests / ci (8.4) (pull_request) Successful in 1m22s
Enforce request validation style rules
2026-04-11 19:44:21 +02:00

1.5 KiB

name, description
name description
project-request-validation-style Always apply in this project when changing Laravel controllers or FormRequest classes. Enforces dedicated FormRequest usage for controller validation, validated-array access via Arr::get(), and forbids custom single-field getter methods or request helper extraction like boolean()/integer()/string() for app input handling.

Project Request Validation Style

When to Apply

Activate this skill whenever work in this project changes:

  • Laravel controllers
  • Laravel FormRequest classes
  • Validation flow between controllers and requests

Rules

  • Do not add inline controller validation with $request->validate(...) when the endpoint has request-specific validation needs.
  • Prefer dedicated FormRequest classes and use $validated = $request->validated(); in controllers.
  • When reading validated arrays, use Arr::get($validated, 'key') instead of direct array access.
  • Do not use request helper extraction like $request->boolean(), $request->integer(), $request->string(), or similar helpers for application input handling.
  • Do not add custom FormRequest getter helpers such as points(), branchName(), ticketAttributes(), or similar single-purpose accessors.
  • Build controller payloads from the validated array directly with Arr::get(...).

Notes

  • Arr::get(...) already returns null by default, so do not wrap it in redundant existence checks when null is acceptable.
  • Keep validation logic in the FormRequest and payload shaping in the controller or dedicated action.