laravel-security

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

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/mitul-bhatia/Vibes --skill laravel-security-mitul-bhatia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-security
Source: https://github.com/mitul-bhatia/Vibes/tree/main/.github/skills/laravel-security
Command: npx skills add https://github.com/mitul-bhatia/Vibes --skill laravel-security-mitul-bhatia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel security best practices address the common vulnerabilities in web applications by guiding developers to harden authentication, authorization, input validation, CSRF protection, rate limiting, secrets handling, and secure deployment.

Core Features & Use Cases

  • Baseline protections through middleware (CSRF verification, security headers).
  • Guards, policies, and form requests to enforce access and validate input.
  • Rate limiting and token management to mitigate abuse.
  • Secrets management, encrypted attributes, and signed URLs for secure data handling.
  • Guidance for secure deployment settings and environment hardening with production-ready defaults and best practices.

Quick Start

Apply the Laravel security guidelines to harden auth, validation, and deployment in your project.

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?

Secure Laravel authentication and authorization by applying guards and policies to enforce access control. Use form requests to validate input and middleware to verify CSRF tokens, ensuring baseline protections are active across all application routes.

What's the best way to implement rate limiting to mitigate API abuse in Laravel?

Implement Laravel rate limiting via middleware to mitigate API abuse and control request frequency. Combine this with token management and secure headers to protect endpoints from excessive traffic and unauthorized access attempts.

How do I handle secrets and encrypt sensitive attributes in Laravel?

Handle Laravel secrets by using encrypted attributes for sensitive database fields and managing environment variables securely. Use signed URLs for secure data handling and ensure secrets are never exposed in source control or client-side code.

Do I need to set APP_DEBUG=false for secure Laravel deployment?

Yes, setting APP_DEBUG=false is a critical requirement for secure Laravel deployment. Production readiness also requires rotating the APP_KEY, using secure cookies, and configuring signed URLs to prevent sensitive information exposure.

How does CSRF protection work with Laravel form requests and middleware?

Laravel CSRF protection works by verifying tokens through middleware on incoming POST, PUT, and DELETE requests. Form requests complement this by validating input data structure and content, ensuring both the request origin and payload are safe.

Can I use Laravel policies and guards for custom authorization rules?

Yes, Laravel policies and guards allow you to define custom authorization rules for specific models and user roles. This enforces granular access control across your application, ensuring users can only interact with resources they are permitted to access.