request
Automates the creation of Laravel-style form request validation classes based on field definitions.
Install
mkdir -p .claude/skills/request && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8587" && unzip -o skill.zip -d .claude/skills/request && rm skill.zipInstalls to .claude/skills/request
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Generate form request validation for CatchAdmin module.Key capabilities
- →Generate Laravel FormRequest classes
- →Map field types to validation rules
- →Handle unique record exclusions
- →Define custom validation messages
How it works
The skill maps field types to predefined validation rules and generates a PHP class file within the CatchAdmin module structure.
Inputs & outputs
When to use request
- →Generating request classes
- →Defining form validation rules
- →Creating API input schemas
About this skill
Step 5: Generate Request Validation
创建表单验证类。
File Location
modules/{Module}/Http/Requests/{Model}Request.php
Template
<?php
namespace Modules\{Module}\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class {Model}Request extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
// Generated from field definitions
];
}
public function messages(): array
{
return [
// Custom messages
];
}
}
Validation Rules Mapping
| Field Type | Validation Rule |
|---|---|
| string(n), required | 'required|string|max:n' |
| string(n), nullable | 'nullable|string|max:n' |
| integer | 'sometimes|integer|min:0' |
| decimal | 'required|numeric|min:0' |
| tinyint (status) | 'sometimes|integer|in:1,2' |
| foreign_key | 'required|integer|exists:table,id' |
| text | 'nullable|string' |
'required|email|max:100' | |
| date | 'nullable|date' |
Unique Validation
对于更新操作,需要排除当前记录:
public function rules(): array
{
$id = $this->route('id');
return [
'email' => "required|email|unique:{table},email,{$id}",
];
}
When not to use it
- →Validating non-Laravel applications
- →Complex cross-field validation logic
Prerequisites
Limitations
- →Limited to CatchAdmin module structure
How it compares
It automates the creation of boilerplate validation classes based on a schema mapping, rather than manually writing rules.
Compared to similar skills
request side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| request (this skill) | 0 | 6mo | No flags | Beginner |
| pennant-development | 2 | 5mo | No flags | Intermediate |
| extending-shopper | 1 | 4mo | No flags | Intermediate |
| routes | 1 | 6mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by JaguarJack
View all by JaguarJack →You might also like
pennant-development
laravel
Manages feature flags with Laravel Pennant. Activates when creating, checking, or toggling feature flags; showing or hiding features conditionally; implementing A/B testing; working with @feature directive; or when the user mentions feature flags, feature toggles, Pennant, conditional features, rollouts, or gradually enabling features.
extending-shopper
shopperlabs
Provides patterns for extending Laravel Shopper with custom sidebar items, component overrides, event listeners, and domain features like stock, pricing, and media. Use when customizing Shopper behavior.
routes
JaguarJack
Generate route configuration for CatchAdmin module.
controller
JaguarJack
Generate CRUD controller for CatchAdmin module.
filament-5-resources
kooda-ai
Use when: working with Filament 5 Resources, Resource classes, make:filament-resource, simple resources, form(), infolist(), table(), getPages(), resource pages, ViewRecord pages, page routes, ListRecords, CreateRecord, EditRecord, ViewRecord, relation managers, relation pages, getRelations(), getRe
woocommerce-code-review
woocommerce
Review WooCommerce code changes for coding standards compliance. Use when reviewing code locally, performing automated PR reviews, or checking code quality.