laravel-security

Implement secure coding practices and configuration setups for Laravel applications.

3|Updated Apr 9, 2026
One-click install
npx skills add https://github.com/rlagycks/oh-my-forge --skill laravel-security-rlagycks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-security
Source: https://github.com/rlagycks/oh-my-forge/tree/main/skills/laravel-security
Command: npx skills add https://github.com/rlagycks/oh-my-forge --skill laravel-security-rlagycks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides comprehensive security guidance to protect Laravel applications from common vulnerabilities and misconfigurations.

Core Features & Use Cases

  • Access Control: Implements middleware and policies to enforce user authorization in API endpoints.
  • Data Validation: Ensures user inputs are validated and sanitized effectively before processing.
  • Secure Deployment: Guides on hardening session cookies, setting security headers, and configuring trusted proxies to secure production environments.
  • Use Case: Developers can apply these best practices to prevent CSRF, SQL injection, XSS, and session hijacking in their Laravel projects.

Quick Start

Review the security sections to implement CSRF tokens, secure cookies, and authentication safeguards to enhance your Laravel application security.

Frequently Asked Questions about laravel-security

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

FAQPage Schema
How do I prevent CSRF and session hijacking in my Laravel application?

Preventing CSRF and session hijacking in Laravel involves hardening session cookies, using CSRF tokens, and configuring trusted proxies to secure production environments against common web vulnerabilities.

What's the best way to enforce user authorization for API endpoints in Laravel?

The best way to enforce user authorization for Laravel API endpoints is by implementing middleware and policies, which establishes strict access control and ensures only authorized users access protected resources.

How do I sanitize and validate user inputs effectively before processing in Laravel?

Sanitizing and validating user inputs in Laravel requires applying comprehensive data validation rules before processing, ensuring that malicious payloads are neutralized to prevent SQL injection and XSS attacks.

Does this security guidance apply to existing Laravel webapps or only new deployments?

This security guidance applies to both existing and new Laravel webapps, providing configuration setups and secure coding practices that developers can integrate to improve deployment security standards at any stage.

What security headers and environment configurations are needed for a secure Laravel deployment?

A secure Laravel deployment requires setting security headers, hardening environment configurations, and securing session cookies to protect the production environment from common vulnerabilities and misconfigurations.