laravel-security
Laravel security best practices for authn/authz, validation, CSRF, mass assignment, file uploads, secrets, rate limiting, and secure deployment.
Skill by ViewWay
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/viewway-laravel-security
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/laravel-security
What's inside
- Skill name
laravel-security- Description
- Laravel security best practices for authn/authz, validation, CSRF, mass assignment, file uploads, secrets, rate limiting, and secure deployment.
- License
- MIT
- Instructions
- 281 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Laravel Security Best Practices
Comprehensive security guidance for Laravel applications to protect against common vulnerabilities.
## When to Activate
- Adding authentication or authorization
- Handling user input and file uploads
- Building new API endpoints
- Managing secrets and environment settings
- Hardening production deployments
## How It Works
- Middleware provides baseline protections (CSRF via `VerifyCsrfToken`, security headers via `SecurityHeaders`).
- Guards and policies enforce access control (`auth:sanctum`, `$this->authorize`, policy middleware).
- Form Requests validate and shape input (`UploadInvoiceRequest`) before it reaches services.
- Rate limiting adds abuse protection (`RateLimiter::for('login')`) alongside auth controls.
- Data safety comes from encrypted casts, mass-assignment guards, and signed routes (`URL::temporarySignedRoute` + `signed` middleware).
## Core Security Settings
- `APP_DEBUG=false` in production
- `APP_KEY` must be set and rotated on compromise
- Set `SESSION_SECURE_COOKIE=true` and `SESSION_SAME_SITE=lax` (or `strict` for sensitive apps)
- Configure trusted proxies for correct HTTPS detection
## Session and Cookie Hardening
- Set `SESSION_HTTP_ONLY=true` to prevent JavaScript access
- Use `SESSION_SAME_SITE=strict` for high-risk flows
- Regenerate sessions on login and privilege changes
## Authentication and Tokens
- Use Laravel Sanctum or Passport for API auth
- Prefer short-lived tokens with refresh flows for sensitive data
- Revoke tokens on logout and compromised accounts
Example route protection:
```php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
Route::middleware('auth:sanctum')->get('/me', function (Request $request) {
return $request->user();
});
```
## Password Security
- Hash passwords with `Hash::make()` and never store plaintext
- Use Laravel's password broker for reset flows
```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'])]);
```
## Authorization: Policies and Gates
- Use policies for model-level authorization
- Enforce authorization in controllers and services
```php
$this->authorize('update', $project);
```
Use policy middleware for route-level enforcement:
```php
use Illuminate\Support\Facades\Route;
Route::put('/projects/{project}', [ProjectController::class, 'update'])
->middleware(['auth:sanctum', 'can:update,project']);
```
## Validation and Data Sanitization
- Always validate inputs with Form Requests
- Use strict validation rules and type checks
- Never trust request payloads for derived fields
## Mass Assignment Protection
- Use `$fillable` or `$guarded` and avoid `Model::unguard()`
- Prefer DTOs or explicit attribute mapping
## SQL Injection Prevention
- Use Eloquent or query builder parameter binding
- Avoid raw SQL unless strictly necessary
```php
DB::select('select * from users where email = ?', [$email]);
```
## XSS Prevention
- Blade escapes output by default (`{{ }}`)
- Use `{!! !!}` only for trusted, sanitized HTML
- Sanitize rich text with a dedicated library
## CSRF Protection
- Keep `VerifyCsrfToken` middleware enabled
- Include `@csrf` in forms and send XSRF tokens for SPA requests
For SPA authentication with Sanctum, ensure stateful requests are configured:
```php
// config/sanctum.phpFrom ViewWay/hermes-by-everythings, MIT.
More from ViewWay/hermes-by-everythings
- 0.519score
frontend-design-ultimate
ViewWay
Create distinctive, production-grade static sites with React, Tailwind CSS, and shadcn/ui — no mockups needed.
SkillCFreshness: C★ 3Claude Code +9 - 0.511score
docker-patterns
ViewWay
Docker and Docker Compose patterns for local development, container security, networking, volume strategies, and multi-service orchestration.
SkillCFreshness: C★ 3Claude Code +9 - 0.511score
hermes-by-everythings
ViewWay
多平台多语言编码增强套件。整合 ECC + Ralph 最佳能力。 22 Command + 39 Agent + 自动化 Hooks + 学习系统。 支持 TypeScript/Python/Rust/Go/Java/Kotlin 等10种语言。
SkillCFreshness: C★ 3Claude Code +9 - 0.511score
deployment-patterns
ViewWay
Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web…
SkillCFreshness: C★ 3Claude Code +9 - 0.511score
laravel-patterns
ViewWay
Laravel architecture patterns, routing/controllers, Eloquent ORM, service layers, queues, events, caching, and API resources for production apps.
SkillCFreshness: C★ 3Claude Code +9 - 0.508score
code-review
ViewWay
Systematic code review patterns covering security, performance, maintainability, correctness, and testing
SkillCFreshness: C★ 3Claude Code +9 - 0.505score
data-scraper-agent
ViewWay
Build a fully automated AI-powered data collection agent for any public source — job boards, prices, news, GitHub, sports, anything.
SkillCFreshness: C★ 3Claude Code +9 - 0.503score
Diagram
ViewWay
Generate diagrams from descriptions with Mermaid, PlantUML, or ASCII for architecture, flows, sequences, and data models.
SkillCFreshness: C★ 3Claude Code +9 - 0.502score
kotlin-patterns
ViewWay
Idiomatic Kotlin patterns, best practices, and conventions for building robust, efficient, and maintainable Kotlin applications with coroutines, null safety…
SkillCFreshness: C★ 3Claude Code +9 - 0.485score
frontend-slides
ViewWay
Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files.
SkillCFreshness: C★ 3Claude Code +9 - 0.277score
diagram-generator
ViewWay
No description from the publisher yet.
SkillCFreshness: C★ 3Claude Code +9
Signals
- Stars
- 3
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- May 2, 2026 (6 months ago)
- Last release
- May 2, 2026 (6 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/ViewWay/hermes-by-everythings
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from ViewWay
- 0.519score
frontend-design-ultimate
ViewWay
Create distinctive, production-grade static sites with React, Tailwind CSS, and shadcn/ui — no mockups needed.
SkillCFreshness: C★ 3Claude Code +9 - 0.511score
laravel-patterns
ViewWay
Laravel architecture patterns, routing/controllers, Eloquent ORM, service layers, queues, events, caching, and API resources for production apps.
SkillCFreshness: C★ 3Claude Code +9 - 0.511score
deployment-patterns
ViewWay
Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web…
SkillCFreshness: C★ 3Claude Code +9 - 0.511score
docker-patterns
ViewWay
Docker and Docker Compose patterns for local development, container security, networking, volume strategies, and multi-service orchestration.
SkillCFreshness: C★ 3Claude Code +9 - 0.511score
hermes-by-everythings
ViewWay
多平台多语言编码增强套件。整合 ECC + Ralph 最佳能力。 22 Command + 39 Agent + 自动化 Hooks + 学习系统。 支持 TypeScript/Python/Rust/Go/Java/Kotlin 等10种语言。
SkillCFreshness: C★ 3Claude Code +9 - 0.508score
code-review
ViewWay
Systematic code review patterns covering security, performance, maintainability, correctness, and testing
SkillCFreshness: C★ 3Claude Code +9
Cite this page
laravel-security skill. Agent Mart. https://agentmart.dev/skills/viewway-laravel-security (last updated 2026-10-24)