laravel-security

Apply security controls across Laravel authentication, authorization, CSRF, validation, and deployment.

1|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/xxih/ai-harness-zh --skill laravel-security-xxih
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-security
Source: https://github.com/xxih/ai-harness-zh/tree/main/references/translations/everything-claude-code/docs/zh-CN/skills/laravel-security
Command: npx skills add https://github.com/xxih/ai-harness-zh --skill laravel-security-xxih

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel security is often fragmented across authentication, authorization, CSRF, validation, file uploads, key management, rate limiting, and deployment. This skill consolidates best practices to reduce risk across Laravel projects.

Core Features & Use Cases

  • Authentication/Authorization governance: implement guards, policies, and middleware to enforce proper access control.
  • Validation & CSRF hardening: use Form Requests and CSRF protection to ensure trusted input handling.
  • Secure data handling & deployment: manage keys securely, enable encrypted attributes, use signed URLs, and apply secure deployment configurations.
  • Use Case: securing an admin panel or API backend with multi-role access and protected endpoints.

Quick Start

Audit your Laravel project to enforce authentication/authorization, CSRF protection, input validation, secure file uploads, and rate limiting, then implement the recommended guards, policies, and secure deployment settings.

Frequently Asked Questions about laravel-security

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

FAQPage Schema
How do I secure a Laravel API with proper authentication and authorization?

Securing a Laravel API requires implementing guards, policies, and middleware to enforce strict access control across multi-role endpoints. This prevents unauthorized data leakage by ensuring only authenticated requests reach protected resources.

What's the best way to handle CSRF protection and input validation in Laravel?

The best way to handle CSRF protection and input validation in Laravel is by using Form Requests. This approach ensures trusted input handling by centralizing validation rules and automatically validating incoming form data before it reaches your controllers.

Does Laravel support encrypted attributes and secure key management out of the box?

Yes, Laravel supports encrypted attributes and secure key management through its configuration. You can encrypt model attributes directly and manage application keys securely to protect sensitive data at rest within your database.

How do I implement rate limiting for Laravel web interfaces?

You can implement rate limiting in Laravel by applying built-in throttling middleware to your routes or controllers. This restricts the number of requests a user can make in a given timeframe, protecting your application from abuse and brute-force attacks.

When should I use signed URLs in my Laravel application?

You should use signed URLs in Laravel when you need to provide temporary, verifiable access to protected routes, such as password reset links or file download endpoints. They prevent users from guessing or manipulating URL parameters to access unauthorized resources.