This is a thorough security reference that covers the entire Laravel attack surface, from CSRF and mass assignment to rate limiting and signed URLs. You'll want it active when building auth flows, handling file uploads, or hardening APIs for production. It's opinionated in the right ways: encrypted casts for sensitive data, strict Form Request validation, policy middleware on routes, and practical rate limiting by both IP and email. The code examples are production-ready, not toy demos. If you're moving fast and need to know whether you've missed something obvious like SESSION_SECURE_COOKIE or wildcard CORS origins, this catches it.

install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
5
skills.sh installs
5.7K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill laravel-security --agent claude-code

Installs into .claude/skills of the current project.

Files

Laravel Security Best Practices

Comprehensive security guidelines for Laravel applications to protect against common vulnerabilities.

When to Activate

  • Setting up Laravel authentication and authorization (Sanctum, Passport, Jetstream, Breeze)
  • Implementing user roles, permissions, and policies
  • Configuring production security settings and environment variables
  • Reviewing Laravel applications for security vulnerabilities
  • Deploying Laravel applications to production
  • Writing secure Eloquent queries and migrations

Production Configuration

Essential Production Settings

// config/app.php
'env' => env('APP_ENV', 'production'),
'debug' => (bool) env('APP_DEBUG', false), // CRITICAL: Never true in production
'key' => env('APP_KEY'), // Must be set: php artisan key:generate

// config/session.php
'secure' => env('SESSION_SECURE_COOKIE', true),
'http_only' => true,
'same_site' => 'lax',

// Verify APP_KEY is set at boot
// bootstrap/app.php or a service provider
if (empty(config('app.key'))) {
    throw new RuntimeException('APP_KEY is not set. Run: php artisan key:generate');
}

Environment File Security

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Categories
Security, PHP & Laravel
First seen
Apr 16, 2026

More from affaan-m/everything-claude-code

All 256

Recommended

More Security
1affaan-m avatarsecurity-bounty-hunteraffaan-m/eccHunt for exploitable, bounty-worthy security issues in repositories. Focuses on remotely reachable vulnerabilities that qualify for real reports instead of nois5.5Kskills.sh installs
2yaklang avatarauthbypass-authentication-flawsyaklang/hack-skillsAuthentication bypass testing playbook. Use when assessing login flows, password reset logic, account recovery, MFA bypass, token predictability, brute-force re4Kskills.sh installs
3yaklang avatarjwt-oauth-token-attacksyaklang/hack-skillsJWT and OAuth token attack playbook. Use when validating token trust, signing algorithms, key handling, claim abuse, bearer flows, and OAuth account-binding wea4Kskills.sh installs
4affaan-m avatarsecurity-bounty-hunteraffaan-m/everything-claude-codesecurity bounty hunter3.7Kskills.sh installs
5elastic avatarelasticsearch-security-troubleshootingelastic/agent-skillsDiagnose and resolve Elasticsearch security errors: 401/403 failures, TLS problems, expired API keys, role mapping mismatches, and Kibana login issues. Use when2.9Kskills.sh installs
6sickn33 avatarcc-skill-security-reviewsickn33/antigravity-awesome-skillssecurity review1.8Kskills.sh installs