laravel-security

Implement Laravel security best practices for authentication, validation, and deployment hardening.

Updated May 9, 2026
One-click install
npx skills add https://github.com/RambleRainbow/jd --skill laravel-security-ramblerainbow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-security
Source: https://github.com/RambleRainbow/jd/tree/main/.claude/skills/laravel-security
Command: npx skills add https://github.com/RambleRainbow/jd --skill laravel-security-ramblerainbow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel applications are exposed to common security risks including CSRF attacks, SQL injection, insecure authentication, and unprotected file uploads when security best practices are not consistently implemented. This Skill provides actionable, framework-specific guidance to eliminate these gaps and strengthen your Laravel codebase against threats.

Core Features & Use Cases

  • End-to-End Security Guidance: Covers authentication and authorization (Laravel Sanctum, policies), input validation, CSRF protection, mass assignment guards, file upload safety, secret management, rate limiting, and production deployment hardening.
  • Practical Code Examples: Includes ready-to-use Laravel code snippets for implementing security controls like encrypted model casts, signed temporary routes, security headers, and CORS configuration.
  • Use Case: When building a new Laravel API that processes user-uploaded invoices, use this Skill to implement proper Sanctum authentication, validate uploaded file types and sizes, add rate limiting to login endpoints, and configure security headers to block common web attacks.

Quick Start

Use the laravel-security skill to audit your Laravel application's authentication, input validation, and production security configuration for potential vulnerabilities.

Frequently Asked Questions about laravel-security

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

FAQPage Schema
How do I implement secure authentication and authorization in a Laravel API?

Secure Laravel API authentication requires implementing Sanctum for token management and defining policies for authorization. This approach protects API endpoints by validating user access rights against specific resource policies.

What's the best way to prevent mass assignment and SQL injection vulnerabilities in Laravel?

Preventing mass assignment and SQL injection in Laravel requires using Form Request validation and defining guarded model properties. Implementing strict input validation rules blocks malicious user data from manipulating database queries.

How do I secure user file uploads in a Laravel application?

Securing file uploads in Laravel involves validating uploaded file types and sizes using Form Requests. This protects your application by ensuring only permitted file formats are processed and stored during user invoice processing.

Does this Laravel security guidance cover rate limiting and CSRF protection setup?

Yes, Laravel security guidance covers configuring rate limiting for login endpoints and implementing CSRF protection. These features mitigate brute force attacks and prevent cross-site request forgery during web form submission.

How do I configure security headers and encrypted model casts for production deployment?

Configuring security headers and encrypted casts for production deployment involves modifying Laravel middleware and model definitions. This process secures sensitive data attributes and blocks common web attacks during application delivery.