laravel-security

Apply Laravel security hardening with middleware, policies, and Form Requests.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/derekhu0002/ai4pb-orchestrator --skill laravel-security-derekhu0002
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-security
Source: https://github.com/derekhu0002/ai4pb-orchestrator/tree/main/skills/laravel-security
Command: npx skills add https://github.com/derekhu0002/ai4pb-orchestrator --skill laravel-security-derekhu0002

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel security concerns across authn/authz, validation, CSRF, mass assignment, file uploads, secrets, rate limiting, and deployment hardening.

Core Features & Use Cases

  • Middleware-based protections (VerifyCsrfToken, SecurityHeaders)
  • Guards and policies for access control
  • Form Requests for input validation
  • Rate limiting for API abuse
  • Encrypted attributes and signed URLs for data protection

Quick Start

Execute the recommended Laravel security hardening steps in your app by enabling the middleware and policies described above and applying the Form Requests for input handling.

Frequently Asked Questions about laravel-security

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

FAQPage Schema
How do I secure Laravel authentication and authorization using guards and policies?

Secure Laravel authentication by implementing guards and policies to enforce strict access control across web APIs and admin interfaces. This approach applies battle-tested defaults to protect your application from common authorization vulnerabilities.

What's the best way to handle input validation and prevent mass assignment in Laravel?

Handle input validation by applying Form Requests to validate incoming data and prevent mass assignment vulnerabilities. This ensures secure behavior by enforcing strict validation rules before data reaches your application models.

How do I add CSRF protection and security headers in Laravel middleware?

Add CSRF protection by enabling VerifyCsrfToken and SecurityHeaders middleware in your Laravel application. These middleware components implement protective headers and verify tokens to defend against cross-site request forgery attacks.

How do I apply rate limiting to protect Laravel APIs from abuse?

Apply rate limiting to protect Laravel APIs from abuse by configuring rate limiting middleware. This restricts excessive requests and safeguards your web APIs and admin interfaces from automated attacks and unauthorized usage.

Does this Laravel security approach handle encrypted attributes and signed URLs?

Yes, the Laravel security approach handles encrypted attributes and signed URLs for data protection. It implements these mechanisms alongside secure file uploads and secret management to enforce secure behavior across your application.

What deployment hardening steps are needed for a secure Laravel application?

Deployment hardening for a secure Laravel application requires applying best practices across secret management, security headers, and middleware protections. This ensures your web APIs and admin interfaces maintain secure behavior in production environments.