laravel-security

Harden Laravel authentication, authorization, validation, CSRF, and deployment security.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Maelwalser/claude-config --skill laravel-security-maelwalser
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-security
Source: https://github.com/Maelwalser/claude-config/tree/main/skills/laravel-security
Command: npx skills add https://github.com/Maelwalser/claude-config --skill laravel-security-maelwalser

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel security best practices address common hardening needs for Laravel applications, covering authentication, authorization, input validation, CSRF protection, file uploads, session handling, and deployment hardening.

Core Features & Use Cases

  • Secure authentication and authorization: apply guards, policies, and token-based access control to protect resources.
  • Input validation and data sanitization: standardize validation rules and prevent injection or invalid data processing.
  • CSRF protection and secure session handling: ensure CSRF tokens, proper cookies, and secure sessions in production.
  • Secure defaults for deployments: set APP_ENV, APP_DEBUG, encryption keys, and trusted proxies to minimize surface area.

Quick Start

Employ the Laravel security best practices to harden your Laravel project by enabling CSRF, tightening validation, and configuring secure headers.

Frequently Asked Questions about laravel-security

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

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

To secure Laravel authentication and authorization, apply proper middleware, configure guards and policies, and implement token-based access control to protect resources across API and web interfaces.

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

The best way to prevent injection in Laravel is to standardize input validation rules and sanitize data, ensuring invalid data processing is blocked before reaching your application logic.

How does CSRF protection work with secure session handling in Laravel production?

Laravel CSRF protection works by validating tokens on form submissions, paired with secure session handling that enforces proper cookie configurations to maintain safe production environments.

Do I need to configure trusted proxies and APP_DEBUG for Laravel deployment hardening?

Yes, Laravel deployment hardening requires configuring trusted proxies, setting APP_ENV and APP_DEBUG to secure defaults, and managing encryption keys to minimize the application's attack surface area.

Can I use Laravel policies and guards to protect both API and web routes?

Yes, you can use Laravel policies and guards to protect both API and web routes by applying proper middleware and token-based access control to ensure secure resource authorization.

Why does Laravel file upload validation fail to prevent invalid data processing?

Laravel file upload validation fails to prevent invalid data processing when validation rules are not properly standardized or input sanitization is missing, allowing potentially malicious files to bypass checks.