laravel-security

Harden Laravel applications with security guidance for authentication, validation, and deployment.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/mkopcic/md-solutions.hr-racuni-app --skill laravel-security-mkopcic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-security
Source: https://github.com/mkopcic/md-solutions.hr-racuni-app/tree/main/.github/skills/laravel-security
Command: npx skills add https://github.com/mkopcic/md-solutions.hr-racuni-app --skill laravel-security-mkopcic

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel applications risk insecure authentication, authorization, input validation, CSRF vulnerabilities, mismanaged secrets, and unsafe deployment practices. This Skill consolidates security best practices to harden Laravel apps across authn/authz, validation, CSRF, mass assignment, file uploads, secrets management, rate limiting, and deployment.

Core Features & Use Cases

  • Auth & Authorization: implement guards, policies, and secure access controls across APIs and web routes.
  • Input Validation & Data Sanitization: enforce strict Form Requests, request validation, and safe mass assignment.
  • Secure Deployment & Secrets: proper env handling, app key management, secure headers, and config caching.

Quick Start

Enable CSRF protection, configure Sanctum for API auth, and rotate the app key to begin hardening your Laravel project.

Frequently Asked Questions about laravel-security

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

FAQPage Schema
How do I harden Laravel authentication and authorization for APIs and web routes?

Harden Laravel authentication by implementing secure auth guards and policies across API and web interfaces. You can configure Sanctum for API auth and enforce strict access controls to protect user authentication workflows and ensure proper policy enforcement.

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

Prevent mass assignment in Laravel by enforcing strict Form Requests and secure request validation. This approach ensures robust data sanitization and protects against insecure input validation vulnerabilities.

How do I manage environment secrets and rotate the app key securely in Laravel?

Manage Laravel secrets securely by applying proper environment handling, encrypted casts, and app key rotation. This ensures safe secret management and prevents mismanaged environment configurations in production deployments.

Does this Laravel security guidance apply to existing projects or only new ones?

This Laravel security guidance applies to both new and existing projects. It provides actionable hardening configurations for authentication, validation, file uploads, and deployment across any Laravel application.

How do I configure secure headers, CSRF protection, and rate limiting in Laravel?

Configure Laravel security by enabling CSRF protection, applying secure headers, and implementing rate limiting. These hardening practices codify practical security requirements directly into your code and deployment pipelines.