laravel-security

Implements Laravel-specific hardening for authentication, authorization, sessions, and code security.

1|Updated Mar 3, 2026
One-click install
npx skills add https://github.com/samymity/bridge-ventures-backend --skill laravel-security-samymity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-security
Source: https://github.com/samymity/bridge-ventures-backend/tree/main/.claude/skills/laravel-security
Command: npx skills add https://github.com/samymity/bridge-ventures-backend --skill laravel-security-samymity

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents common Laravel security vulnerabilities by guiding developers to implement safer authentication, authorization, input handling, file uploads, secrets management, and production hardening practices.

Core Features & Use Cases

  • Authn/Authz protections: Use Sanctum auth middleware, policies/gates, and signed routes to enforce access control and reduce unauthorized access.
  • Safer request handling: Validate and shape user input with Form Requests to reduce injection, mass-assignment, and trust-boundary mistakes.
  • Defense-in-depth hardening: Apply rate limiting, secure cookie/session settings, CSRF protection, security headers, encrypted attributes, and secure deployment guidance.

Quick Start

Ask an AI to review your Laravel auth endpoints and propose specific middleware, validation rules, upload handling, and rate-limiting changes based on this laravel-security guide.

Frequently Asked Questions about laravel-security

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

FAQPage Schema
How do I secure Laravel API routes using authentication and authorization middleware?

To secure Laravel API routes, apply Sanctum auth middleware and enforce access control using policies and gates. This prevents unauthorized access by validating user credentials and permissions before processing requests to protected endpoints.

What is the best way to prevent mass assignment and validate user input in Laravel?

Use Laravel Form Requests to validate and shape user input, preventing mass-assignment and injection mistakes. This ensures only validated data fills models, maintaining strict trust boundaries for application security.

How do I add rate limiting to Laravel login and sensitive actions?

Add rate limiting to Laravel login and sensitive actions by configuring throttle middleware on those routes. This defends against brute-force attacks by restricting repeated request attempts from a single source.

Can I use Laravel policies and gates for role-based access control?

Yes, you can use Laravel policies and gates for role-based access control. They provide a structured mechanism to enforce authorization logic across user actions, ensuring users only access permitted resources.

How do I harden Laravel sessions, cookies, and file uploads for production?

Harden Laravel sessions and cookies by applying secure settings and CSRF protection, and handle file uploads with strict validation and safe storage practices. This reduces vulnerability exposure in production environments.

Does Laravel security best practices require encrypted attributes and secure secret handling?

Yes, Laravel security best practices require encrypting sensitive attributes and handling secrets safely. Using Laravel’s built-in encryption mechanisms protects sensitive data at rest and avoids hardcoding credentials.