laravel-security

Harden Laravel applications against common security vulnerabilities.

Updated Jan 19, 2026
One-click install
npx skills add https://github.com/Reshzy/AgricultureRMS --skill laravel-security-reshzy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-security
Source: https://github.com/Reshzy/AgricultureRMS/tree/main/.cursor/skills/laravel-security
Command: npx skills add https://github.com/Reshzy/AgricultureRMS --skill laravel-security-reshzy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides practical, actionable guidance to reduce security risks in Laravel applications by addressing common vulnerabilities across authentication, input handling, file uploads, secrets, and deployment configuration.

Core Features & Use Cases

  • Authentication & Authorization: Guidance on using Sanctum/Passport, token lifecycle, guards, policies, and route middleware to protect endpoints.
  • Input Validation & Data Safety: Recommendations for Form Requests, strict validation rules, mass-assignment protection, and encrypted attribute casts.
  • Session, CSRF & XSS Protections: Best practices for secure session cookies, CSRF middleware use, output escaping, and header-based defenses.
  • File Uploads & Rate Limiting: Validation of uploads, non-public storage recommendations, and throttling strategies for sensitive endpoints.
  • Secrets, Deployment & Headers: Advice on environment secrets, key rotation, trusted proxies, security headers, and signed routes for temporary links.
  • Use Case: Use this guidance to perform a security hardening pass before production deployment or to audit authentication and file upload flows after feature additions.

Quick Start

Use the laravel-security guidance to review my Laravel project and produce prioritized hardening recommendations for authentication, validation, file uploads, environment settings, and deployment configuration.

Frequently Asked Questions about laravel-security

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

FAQPage Schema
How do I protect Laravel applications from common security vulnerabilities like XSS and CSRF?

To protect Laravel applications from security vulnerabilities, apply secure session cookies, CSRF middleware, output escaping, and header-based defenses against XSS and CSRF threats.

What is the best way to enforce authentication and authorization in Laravel API endpoints?

Enforce authentication and authorization in Laravel by using Sanctum or Passport, configuring token lifecycle, applying guards and policies, and protecting API endpoints with route middleware.

How do I prevent mass assignment and validate file uploads in Laravel?

Prevent mass assignment and validate file uploads in Laravel by using strict Form Requests, applying mass-assignment protection, validating uploads, and storing files in non-public storage.

How do I secure environment secrets and configure security headers for Laravel production deployment?

Secure Laravel production deployment by managing environment secrets, rotating keys, configuring trusted proxies, setting security headers, and using signed routes for temporary links.

Can I use rate limiting to protect sensitive Laravel endpoints from abuse?

Yes, you can apply rate limiting in Laravel to protect sensitive endpoints by configuring throttling strategies that restrict excessive requests and mitigate abuse.

When do I need to use encrypted attribute casts and signed routes in Laravel?

Use encrypted attribute casts in Laravel to secure sensitive database fields and signed routes to generate tamper-proof temporary links for secure access.