0095-laravel-validation-patterns
CommunityValidate Laravel inputs safely and consistently
Software Engineering#validation#laravel#custom rules#form request#conditional validation#nested array validation#safe data handling
AuthorMrJmpl3
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill helps you avoid insecure, inconsistent, and hard-to-test request validation in Laravel by showing production-ready patterns for Form Requests, custom rules, conditional and nested validation, and safe data handling.
Core Features & Use Cases
- Form Request validation patterns: Centralize validation with
authorize(),rules(), custommessages(), and lifecycle hooks likeprepareForValidation()andafter(). - Reusable custom validation rules: Implement rule objects (e.g., password complexity) and plug them directly into request rules.
- Conditional, array, and nested validation: Apply rules based on other fields (
required_if,exclude_if,Rule::when) and validate complex payloads using wildcard syntax (items.*.field,tags.*). - Database-backed constraints: Use
Rule::unique()withignore()and scoping (where(...)), andRule::exists()with additional constraints. - Enum validation and safe persistence: Validate enums with
Rule::enum()and consistently use validated/safe request data (validated(),safe()) instead of raw input to prevent accidental trust of untrusted fields. - Common pitfalls and guardrails: Avoid controller-level inline validation, ensure correct failure behavior (
bail), and prevent unsafe writes using$request->all()/$request->input().
Quick Start
Use the 0095-laravel-validation-patterns skill to draft a Form Request for your endpoint that includes authorization, sanitization, conditional rules, and safe persistence using validated data only.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: 0095-laravel-validation-patterns Download link: https://github.com/MrJmpl3/codex_____data_____configuration/archive/main.zip#0095-laravel-validation-patterns Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.