laravel:form-requests

Move Laravel validation and authorization logic into dedicated Form Request classes.

1|Updated Sep 22, 2025
One-click install
npx skills add https://github.com/meistro57/chat_bridge --skill laravel-form-requests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel:form-requests
Source: https://github.com/meistro57/chat_bridge/tree/main/.claude/skills/form-requests-and-validation
Command: npx skills add https://github.com/meistro57/chat_bridge --skill laravel-form-requests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill centralizes validation and authorization logic, preventing controllers from becoming bloated with these concerns and improving code organization.

Core Features & Use Cases

  • Decoupled Validation: Move complex validation rules into dedicated Form Request classes.
  • Authorization Gates: Define access control within Form Requests using the authorize() method.
  • Use Case: When updating a user profile, all the checks for required fields, email format, and whether the current user is authorized to make the change are handled by the UpdateProfileRequest before the controller method even executes.

Quick Start

Create a new form request for handling user profile updates by running the command: sail artisan make:request UpdateProfileRequest.

Frequently Asked Questions about laravel:form-requests

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

FAQPage Schema
How do I move validation logic out of my Laravel controllers?

Form requests centralize Laravel validation and authorization logic in dedicated classes, keeping controllers slim by handling required fields, email formats, and access control before the controller method executes.

How do I handle authorization checks in Laravel before a controller executes?

You handle Laravel authorization checks by defining an authorize() method within a Form Request class, which validates user access control before the controller method even executes.

How do I create a Form Request class in Laravel for updating user profiles?

Create a Form Request class in Laravel by running the artisan command to generate a request class, then define your validation rules, custom messages, and authorization logic within that dedicated file.

Can Form Requests handle nested data and custom validation messages in Laravel?

Yes, Laravel Form Requests support handling nested data structures and defining custom validation messages, allowing you to manage complex validation scenarios outside of your main controller logic.

When should I use Form Requests instead of inline validation in Laravel controllers?

Use Form Requests instead of inline Laravel controller validation when you need to decouple complex validation rules and authorization gates, preventing your controllers from becoming bloated with these concerns.