laravel-security

Enforce Laravel security best practices for validation, authorization, and data handling.

1|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/sasabajic/laravel-best-practice-skills --skill laravel-security-sasabajic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-security
Source: https://github.com/sasabajic/laravel-best-practice-skills/tree/main/laravel-security
Command: npx skills add https://github.com/sasabajic/laravel-best-practice-skills --skill laravel-security-sasabajic

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the critical need to implement robust security measures in Laravel applications, preventing common vulnerabilities and protecting against attacks.

Core Features & Use Cases

  • Vulnerability Prevention: Identifies and mitigates risks like SQL Injection, XSS, Mass Assignment, and Broken Access Control.
  • Secure Input Handling: Enforces strict validation using Form Requests and sanitizes user input.
  • Authorization: Guides the implementation of secure authorization with Policies and Gates.
  • Use Case: When developing a new user registration endpoint, this Skill ensures that all input is validated, passwords are securely hashed and confirmed, and authorization checks are in place before user creation.

Quick Start

Use the laravel-security skill to implement secure file upload validation for an avatar field.

Frequently Asked Questions about laravel-security

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

FAQPage Schema
How do I prevent SQL injection and XSS vulnerabilities in my Laravel application?

Laravel prevents SQL injection and XSS vulnerabilities by enforcing strict input validation through Form Requests and guiding secure data sanitization patterns to ensure user input is safely handled before database querying or output rendering.

What is the best way to implement robust authorization and access control in Laravel?

Robust authorization and access control in Laravel is best implemented by using Policies and Gates to define secure permissions, ensuring strict access checks are in place before processing actions like user creation or data modification.

How do I securely validate and handle file uploads like avatars in Laravel?

Securely validating file uploads in Laravel requires using Form Requests to enforce strict validation rules on the avatar field, ensuring the uploaded file is properly sanitized and checked before being stored or processed.

When do I need Form Requests for secure input sanitization in a Laravel registration endpoint?

You need Form Requests for secure input sanitization in a Laravel registration endpoint when you must validate all incoming user data, ensure passwords are securely hashed, and confirm authorization checks before user creation.

Does this approach help mitigate mass assignment risks during Laravel user creation?

Yes, this approach mitigates mass assignment risks during Laravel user creation by enforcing secure coding patterns that validate input and apply strict authorization checks before data is assigned to models.