Agent skill

Laravel Security

by affaan-m in affaan-m/ECC

Laravel security best practices for authn/authz, validation, CSRF, mass assignment, file uploads, secrets, rate limiting, and secure deployment.

MITAuto-check passedBackend & APIs

Install Laravel Security

skills CLI
$ npx skills add affaan-m/ECC --skill laravel-security -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install affaan-m/ECC laravel-security --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .claude/skills && cp -r skills-src/docs/tr/skills/laravel-security .claude/skills/laravel-security && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
laravel-security
GitHub stars
277k
Used in
3 other repos
Token cost
~2k tokens
SKILL.md length
489 words
Files
1
Skills in repo
683
Repo updated
First seen
Licence
MIT

At a glance

Laravel security best practices for authn/authz, validation, CSRF, mass assignment, file uploads, secrets, rate limiting, and secure deployment.

  • Tasks that involve Backend development
  • SKILL.md covers Ne Zaman Aktif Edilir, Nasıl Çalışır, Temel Güvenlik Ayarları and Session ve Cookie Sertleştirme, plus 17 more sections
  • Calls composer; needs APP_KEY
  • Tasks that involve Web application vulnerabilities

What it does

Laravel Security is an agent skill from affaan-m/ECC. Laravel security best practices for authn/authz, validation, CSRF, mass assignment, file uploads, secrets, rate limiting, and secure deployment.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Backend development, Web application vulnerabilities and Rate limiting. It works with Laravel. The repository describes itself as: The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond. The licence is MIT.

When your agent uses it

  • Tasks that involve Backend development
  • Tasks that involve Web application vulnerabilities
  • Tasks that involve Rate limiting

Example prompts

  • “/laravel-security”

Requirements

  • A credential in APP_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit 2d515e4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • composer

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • APP_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Laravel Security loads about 2k tokens when it runs. Until then it costs about 40 tokens; SKILL.md has 489 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~40
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from affaan-m/ECC at commit 2d515e4, republished under its MIT licence (© affaan-m). 489 words, ~2,018 tokens.

Download SKILL.mdSave it as .claude/skills/laravel-security/SKILL.md (or your agent's skills folder).
name
laravel-security
description
Laravel security best practices for authn/authz, validation, CSRF, mass assignment, file uploads, secrets, rate limiting, and secure deployment.
origin
ECC

Laravel Güvenlik En İyi Uygulamaları

Laravel uygulamalarını yaygın güvenlik açıklarına karşı korumak için kapsamlı güvenlik rehberi.

Ne Zaman Aktif Edilir

  • Kimlik doğrulama veya yetkilendirme ekleme
  • Kullanıcı girişi ve dosya yüklemelerini işleme
  • Yeni API endpoint'leri oluşturma
  • Gizli bilgileri ve ortam ayarlarını yönetme
  • Production deployment'ları sertleştirme

Nasıl Çalışır

  • Middleware temel korumalar sağlar (CSRF için VerifyCsrfToken, güvenlik başlıkları için SecurityHeaders).
  • Guard'lar ve policy'ler erişim kontrolünü zorlar (auth:sanctum, $this->authorize, policy middleware).
  • Form Request'ler servislere ulaşmadan önce girişi doğrular ve şekillendirir (UploadInvoiceRequest).
  • Rate limiting, auth kontrolleri ile birlikte kötüye kullanım koruması ekler (RateLimiter::for('login')).
  • Veri güvenliği encrypted cast'lerden, mass-assignment korumalarından ve signed route'lardan gelir (URL::temporarySignedRoute + signed middleware).

Temel Güvenlik Ayarları

  • Production'da APP_DEBUG=false
  • APP_KEY ayarlanmalı ve tehlikeye girdiğinde döndürülmelidir
  • SESSION_SECURE_COOKIE=true ve SESSION_SAME_SITE=lax ayarlayın (veya hassas uygulamalar için strict)
  • Doğru HTTPS algılama için güvenilir proxy'leri yapılandırın
  • JavaScript erişimini önlemek için SESSION_HTTP_ONLY=true ayarlayın
  • Yüksek riskli akışlar için SESSION_SAME_SITE=strict kullanın
  • Login ve ayrıcalık değişikliklerinde session'ları yeniden oluşturun

Kimlik Doğrulama ve Token'lar

  • API kimlik doğrulama için Laravel Sanctum veya Passport kullanın
  • Hassas veriler için yenileme akışları ile kısa ömürlü token'ları tercih edin
  • Logout ve tehlikeye girmiş hesaplarda token'ları iptal edin

Örnek route koruması:

php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

Route::middleware('auth:sanctum')->get('/me', function (Request $request) {
    return $request->user();
});

Parola Güvenliği

  • Hash::make() ile parolaları hash'leyin ve asla düz metin saklamayın
  • Sıfırlama akışları için Laravel'in password broker'ını kullanın
php
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\Rules\Password;

$validated = $request->validate([
    'password' => ['required', 'string', Password::min(12)->letters()->mixedCase()->numbers()->symbols()],
]);

$user->update(['password' => Hash::make($validated['password'])]);

Yetkilendirme: Policy'ler ve Gate'ler

  • Model seviyesi yetkilendirme için policy'leri kullanın
  • Controller'larda ve servislerde yetkilendirmeyi zorlayın
php
$this->authorize('update', $project);

Route seviyesi zorlama için policy middleware kullanın:

php
use Illuminate\Support\Facades\Route;

Route::put('/projects/{project}', [ProjectController::class, 'update'])
    ->middleware(['auth:sanctum', 'can:update,project']);

Validation ve Veri Temizleme

  • Her zaman Form Request'ler ile girişleri doğrulayın
  • Sıkı validation kuralları ve tip kontrolleri kullanın
  • Türetilmiş alanlar için request payload'larına asla güvenmeyin

Mass Assignment Koruması

  • $fillable veya $guarded kullanın ve Model::unguard() kullanmaktan kaçının
  • DTO'ları veya açık attribute mapping'i tercih edin

SQL Injection Önleme

  • Eloquent veya query builder parametre binding kullanın
  • Kesinlikle gerekli olmadıkça raw SQL kullanmaktan kaçının
php
DB::select('select * from users where email = ?', [$email]);
Show full SKILL.md (203 more words)Show less

XSS Önleme

  • Blade varsayılan olarak çıktıyı escape eder ({{ }})
  • {!! !!} sadece güvenilir, temizlenmiş HTML için kullanın
  • Zengin metni özel bir kütüphane ile temizleyin

CSRF Koruması

  • VerifyCsrfToken middleware'ini etkin tutun
  • Formlara @csrf ekleyin ve SPA istekleri için XSRF token'ları gönderin

Sanctum ile SPA kimlik doğrulaması için, stateful isteklerin yapılandırıldığından emin olun:

php
// config/sanctum.php
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', 'localhost')),

Dosya Yükleme Güvenliği

  • Dosya boyutunu, MIME tipini ve uzantısını doğrulayın
  • Mümkün olduğunda yüklemeleri public path dışında saklayın
  • Gerekirse dosyaları malware için tarayın
php
final class UploadInvoiceRequest extends FormRequest
{
    public function authorize(): bool
    {
        return (bool) $this->user()?->can('upload-invoice');
    }

    public function rules(): array
    {
        return [
            'invoice' => ['required', 'file', 'mimes:pdf', 'max:5120'],
        ];
    }
}
php
$path = $request->file('invoice')->store(
    'invoices',
    config('filesystems.private_disk', 'local') // bunu public olmayan bir disk'e ayarlayın
);

Rate Limiting

  • Auth ve yazma endpoint'lerinde throttle middleware'i uygulayın
  • Login, password reset ve OTP için daha sıkı limitler kullanın
php
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;

RateLimiter::for('login', function (Request $request) {
    return [
        Limit::perMinute(5)->by($request->ip()),
        Limit::perMinute(5)->by(strtolower((string) $request->input('email'))),
    ];
});

Gizli Bilgiler ve Kimlik Bilgileri

  • Gizli bilgileri asla kaynak kontrolüne commit etmeyin
  • Ortam değişkenlerini ve gizli yöneticileri kullanın
  • Maruz kalma sonrası anahtarları döndürün ve session'ları geçersiz kılın

Şifreli Attribute'lar

Bekleyen hassas sütunlar için encrypted cast'leri kullanın.

php
protected $casts = [
    'api_token' => 'encrypted',
];

Güvenlik Başlıkları

  • Uygun yerlerde CSP, HSTS ve frame koruması ekleyin
  • HTTPS yönlendirmelerini zorlamak için güvenilir proxy yapılandırması kullanın

Başlıkları ayarlamak için örnek middleware:

php
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;

final class SecurityHeaders
{
    public function handle(Request $request, \Closure $next): Response
    {
        $response = $next($request);

        $response->headers->add([
            'Content-Security-Policy' => "default-src 'self'",
            'Strict-Transport-Security' => 'max-age=31536000', // tüm subdomain'ler HTTPS olduğunda includeSubDomains/preload ekleyin
            'X-Frame-Options' => 'DENY',
            'X-Content-Type-Options' => 'nosniff',
            'Referrer-Policy' => 'no-referrer',
        ]);

        return $response;
    }
}

CORS ve API Erişimi

  • config/cors.php'de origin'leri kısıtlayın
  • Kimlik doğrulamalı route'lar için wildcard origin'lerden kaçının
php
// config/cors.php
return [
    'paths' => ['api/*', 'sanctum/csrf-cookie'],
    'allowed_methods' => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'],
    'allowed_origins' => ['https://app.example.com'],
    'allowed_headers' => [
        'Content-Type',
        'Authorization',
        'X-Requested-With',
        'X-XSRF-TOKEN',
        'X-CSRF-TOKEN',
    ],
    'supports_credentials' => true,
];

Loglama ve PII

  • Parolaları, token'ları veya tam kart verilerini asla loglamayın
  • Yapılandırılmış loglarda hassas alanları redakte edin
php
use Illuminate\Support\Facades\Log;

Log::info('User updated profile', [
    'user_id' => $user->id,
    'email' => '[REDACTED]',
    'token' => '[REDACTED]',
]);

Bağımlılık Güvenliği

  • Düzenli olarak composer audit çalıştırın
  • Bağımlılıkları dikkatle sabitleyin ve CVE'lerde hızlıca güncelleyin

Signed URL'ler

Geçici, kurcalamaya dayanıklı bağlantılar için signed route'ları kullanın.

php
use Illuminate\Support\Facades\URL;

$url = URL::temporarySignedRoute(
    'downloads.invoice',
    now()->addMinutes(15),
    ['invoice' => $invoice->id]
);
php
use Illuminate\Support\Facades\Route;

Route::get('/invoices/{invoice}/download', [InvoiceController::class, 'download'])
    ->name('downloads.invoice')
    ->middleware('signed');

© affaan-m, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in docs/tr/skills/laravel-security of affaan-m/ECC.

Open the folder on GitHubat commit 2d515e4

Used in 3 other repositories

We found 8 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 3 other GitHub owners. This page covers the copy in affaan-m/ECC, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Laravel Security next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Laravel Security compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Laravel Security this skillaffaan-m/ECC277k3 repos~2kAutomated safety check: PassMIT
Spa Auth Developmentgdarko/laravel-vue-starter145—~668Automated safety check: NotesMIT
API Auditbriiirussell/cybersecurity-skills413—~2.8kAutomated safety check: NotesMIT
API Security Designvinayaklatthe/microsoft-security-skills175—~2.2kAutomated safety check: PassMIT
API Security Best Practicesdavila7/claude-code-templates33k8 repos~5.8kAutomated safety check: PassMIT
Frappe Errors APIImpertio-Studio/Frappe_Claude_Skill_Package189—~4kAutomated safety check: PassMIT

Similar skills

  • Spa Auth Development

    gdarko/laravel-vue-starter

    Activate when working on SPA authentication flow, Sanctum cookie-based auth, Vue Router guards, auth store, login/register/password reset pages, or CORS/session configuration.

    145 GitHub stars~668 tokensUpdated 6 mo ago
    Backend & APIsAuto-check: notes
  • API Audit

    briiirussell/cybersecurity-skills

    Audit REST, GraphQL, and RPC APIs against the OWASP API Security Top 10 (2023).

    413 GitHub stars~2.8k tokensUpdated 4 mo ago
    Backend & APIsAuto-check: notes
  • API Security Design

    vinayaklatthe/microsoft-security-skills

    Guidance for designing secure APIs on Azure - authentication, authorization, gateway controls, input validation, rate limiting, secret management, and runtime threat detection - aligned to OWASP API…

    175 GitHub stars~2.2k tokensUpdated 3 mo ago
    Backend & APIsAuto-check passed
  • API Security Best Practices

    davila7/claude-code-templates

    Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities

    33k GitHub starsUsed in 8 repos~5.8k tokens
    Backend & APIsAuto-check passed
  • Frappe Errors API

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when debugging or handling API errors in Frappe/ERPNext v14/v15/v16.

    189 GitHub stars~4k tokensUpdated 24 days ago
    Backend & APIsAuto-check passed
  • Laravel Security

    HoangNguyen0403/agent-skills-standard

    Harden Laravel apps with Policies for model authorization, Gate-based RBAC, validated mass assignment, and CSRF protection.

    572 GitHub stars~887 tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from affaan-m/ECC

All 682 skills in this repo
  • Skill Stocktake

    affaan-m/ECC

    Audits your installed Claude skills and commands for quality, with a quick mode for recently changed skills and a full mode that evaluates all of them through subagents.

    277k GitHub starsUsed in 5 repos~3.1k tokens
    Auto-check passed
  • Ingests, indexes, searches, edits and monitors video, audio and live streams through the VideoDB Python SDK, returning stream links, clips and timestamps.

    277k GitHub starsUsed in 3 repos~3.5k tokens
    Auto-check: notes
  • Docs Governance

    affaan-m/ECC

    Route broad documentation-governance requests to existing ECC skills and run an opt-in, read-only audit of mapped documentation roles, links, ADR indexes, and evidence references.

    277k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Rules Distillation

    affaan-m/ECC

    Scans installed skills for principles that recur across them and proposes rule-file changes: append, revise, add a section, create a file or leave as covered.

    277k GitHub starsUsed in 2 repos~2.3k tokens
    Auto-check passed
  • Builds DRAFT counterparty agreements from one markdown template and a small JSON spec per party, with clauses picked by the party's role.

    277k GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Set an ECC-specific frontend design direction for production UI work.

    277k GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed

Works with

Categories

Questions about Laravel Security

What does Laravel Security do?

Laravel security best practices for authn/authz, validation, CSRF, mass assignment, file uploads, secrets, rate limiting, and secure deployment. Laravel Security is an agent skill from affaan-m/ECC. Laravel security best practices for authn/authz, validation, CSRF, mass assignment, file uploads, secrets, rate limiting, and secure deployment.

When should I use Laravel Security?

Laravel Security fits situations like: tasks that involve Backend development; tasks that involve Web application vulnerabilities; tasks that involve Rate limiting.

How do I install Laravel Security in Claude Code?

Run `npx skills add affaan-m/ECC --skill laravel-security -a claude-code`. Or copy the skill folder (docs/tr/skills/laravel-security in affaan-m/ECC) into .claude/skills/laravel-security in your project. Claude Code loads it when a task matches its description.

How do I install Laravel Security in Codex?

Run `npx skills add affaan-m/ECC --skill laravel-security -a codex`. Or copy the skill folder (docs/tr/skills/laravel-security in affaan-m/ECC) into .agents/skills/laravel-security in your project. Codex loads it when a task matches its description.

Can I use Laravel Security in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add affaan-m/ECC --skill laravel-security -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/laravel-security, .gemini/skills/laravel-security, .github/skills/laravel-security and .opencode/skills/laravel-security in your project.

What does Laravel Security need to run?

Going by SKILL.md and its folder, Laravel Security needs the command-line tools its instructions call (composer) and credentials named APP_KEY. Our summary lists: A credential in APP_KEY.

Does Laravel Security access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Laravel Security safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Laravel Security use?

Laravel Security is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Laravel Security use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Laravel Security?

Skills that share tags, products or a category with Laravel Security: Spa Auth Development (gdarko/laravel-vue-starter, 145 stars), API Audit (briiirussell/cybersecurity-skills, 413 stars), API Security Design (vinayaklatthe/microsoft-security-skills, 175 stars) and API Security Best Practices (davila7/claude-code-templates, 33k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Laravel Security?

affaan-m (a GitHub user) maintains it in affaan-m/ECC, which has 276,673 GitHub stars. The repository holds 683 skills in this directory. The repository was last updated on October 11, 2026.

Source: affaan-m/ECC on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.