Laravel Form Requests & Validation

•
137
•

Refactors Laravel validation and authorization into dedicated Form Request classes to ensure clean, maintainable controllers.

This skill empowers Claude to implement Laravel's best practices for request handling by offloading validation and authorization logic from controllers into dedicated Form Request classes. It guides the creation of robust validation rules, including nested data handling and custom rule objects, while ensuring that controllers remain focused on domain logic. By leveraging this skill, developers can automate the generation of request classes and enforce consistent security and data integrity patterns across their Laravel applications.

Key Features

01Support for complex validation rules including unique constraints and nested array handling
02Guidance on testing validation flows and unit testing custom rule objects
03Automated generation and implementation of Laravel Form Request classes
04Implementation of custom authorization logic within request gates
05Centralization of error messages and attribute naming for consistent API responses
06137 GitHub stars

Use Cases

01Refactoring bloated controller methods by moving validation logic into standalone request classes
02Implementing complex validation for nested JSON payloads in modern API endpoints
03Standardizing authorization checks for specific request types using Laravel's built-in gate logic