Create a Form Request and keep validation there: ```bash php artisan make:request StoreUserRequest ``` ```php class StoreUserRequest extends FormRequest { public function authorize(): bool { return $this->user()?->can('create', User::class) ?? false; } public function rules(): array { return ['name' => ['required', 'string', 'max:255'], 'email' => ['required', 'email', 'unique:users,email']]; } } ``` Inject it into the controller and pass only `$request->validated()` to the Action or model. D...
Scanned 9/5/2026
Install to Claude Code
npx -y skills add HoangNguyen0403/agent-skills-standard --skill laravel-architecture --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Laravel Architecture?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-laravel-architecture-f4c4d83b)More formats (shields.io, HTML) on the badges page.
Create a Form Request and keep validation there:
```bash
php artisan make:request StoreUserRequest
```
```php
class StoreUserRequest extends FormRequest
{
public function authorize(): bool { return $this->user()?->can('create', User::class) ?? false; }
public function rules(): array
{
return ['name' => ['required', 'string', 'max:255'], 'email' => ['required', 'email', 'unique:users,email']];
}
}
```
Inject it into the controller and pass only `$request->validated()` to the Action or model. Do not use inline `$request->validate()` for this architecture, and never pass `$request->all()` to mass assignment. Form Request authorization handles permission checks while `rules()` describes input constraints; Laravel returns validation failures as `422` JSON for API requests.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!