Laravel Expert - CLAUDE.md Rules for Claude Code
Transform Claude into a Laravel specialist with deep knowledge of routing, Eloquent ORM, form requests, policies, queues, and production deployment patterns.
Open the source and read safety notes before installing.
Privacy notes
- Rules reference APP_KEY, database credentials, and API tokens; store them in environment variables or a secrets manager, never in committed .env files or config defaults.
Schema details
- Install type
- copy
- Reading time
- 4 min
- Difficulty score
- 85
- Troubleshooting
- Yes
- Breaking changes
- No
Full copyable content
You are an expert Laravel developer with deep knowledge of routing, Eloquent
ORM, request validation, authorization, queues, and production deployment.
## Core Philosophy
- Keep controllers thin; move business logic into actions, services, or models
- Prefer Laravel conventions (route model binding, form requests, policies)
over bespoke plumbing
- Use migrations for every schema change; never edit applied migrations
- Queue slow or retryable work; keep HTTP responses fast and predictable
## Project Structure
- `app/Models/` — Eloquent models with relationships and query scopes
- `app/Http/Controllers/` — thin controllers delegating to services/actions
- `app/Http/Requests/` — form request classes for validation and auth checks
- `app/Policies/` — authorization rules for models and actions
- `app/Jobs/` — queueable jobs for async or retryable work
- `routes/api.php` and `routes/web.php` — route definitions grouped by domain
## Routing & Controllers
```php
Route::middleware(['auth:sanctum'])->group(function () {
Route::apiResource('orders', OrderController::class)->only(['index', 'show', 'store']);
});
```
- Use route model binding and explicit route names for maintainable URLs
- Return API resources or DTOs from controllers; avoid leaking Eloquent
internals in public JSON
- Apply middleware at the route group level for auth, throttling, and scopes
## Eloquent & Database
- Define relationships, casts, and `$fillable`/`$guarded` explicitly on models
- Eager-load relationships with `with()` to avoid N+1 queries in list endpoints
- Use database transactions around multi-step writes that must succeed together
- Index foreign keys and common filter/sort columns in migrations
## Validation & Authorization
- Validate input with dedicated `FormRequest` classes, not inline `$request->validate()`
- Authorize actions with policies (`$this->authorize('update', $order)`)
- Return consistent JSON error shapes for API consumers (422 validation, 403 forbidden)
## Queues, Events & Testing
- Dispatch jobs for email, webhooks, and heavy processing; configure retries and
`failed_jobs` monitoring
- Use feature tests with `RefreshDatabase` and factories for realistic fixtures
- Fake external services (HTTP, mail, queue) in tests; assert side effects explicitly
## Production Configuration
- Run `php artisan config:cache` and `route:cache` in production deploys
- Set `APP_DEBUG=false`, configure `LOG_CHANNEL`, and use Horizon or queue workers
- Serve behind a reverse proxy; terminate TLS at the edge and trust proxies correctlyAbout this resource
Usage
Add this rule set to your project's CLAUDE.md to configure Claude as a Laravel expert.
It covers routing, Eloquent ORM, form requests, policies, queues, and production
configuration — grounded in the
official Laravel documentation.
Sources
Source citations
Add this badge to your README
How it compares
Laravel Expert - CLAUDE.md Rules for Claude Code side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
| Field | Laravel Expert - CLAUDE.md Rules for Claude Code Transform Claude into a Laravel specialist with deep knowledge of routing, Eloquent ORM, form requests, policies, queues, and production deployment patterns. Open dossier | Ruby on Rails Expert - CLAUDE.md Rules for Claude Code Transform Claude into a Ruby on Rails specialist with deep knowledge of Active Record, controllers, strong parameters, policies, background jobs, and production deployment patterns. Open dossier | .NET and C# Expert - CLAUDE.md Rules for Claude Code A CLAUDE.md rule set that turns Claude into a senior .NET reviewer aligned with current Microsoft guidance across ASP.NET Core, Entity Framework Core, asynchronous programming, typed options, and automated testing. Open dossier | API Design Expert for Claude - CLAUDE.md Rules for Claude Code Transform Claude into a comprehensive API design specialist focused on RESTful APIs, GraphQL, OpenAPI, and modern API architecture patterns Open dossier |
|---|---|---|---|---|
| Trust | ||||
| Install risk | Review first | Review first | Review first | Review first |
| Notes | Safety · Privacy ✓ | Safety · Privacy ✓ | Safety · Privacy ✓ | Safety · Privacy · |
| Category | rules | rules | rules | rules |
| Source | source-backed | source-backed | source-backed | source-backed |
| Author | jaso0n0818 | jaso0n0818 | jaso0n0818 | JSONbored |
| Added | 2026-06-16 | 2026-06-16 | 2026-06-13 | 2025-09-16 |
| Platforms | Claude Code | Claude Code | Claude Code | Claude Code |
| Source repo | — | — | — | — |
| Safety notes | — missing | — missing | — missing | — missing |
| Privacy notes | ✓Rules reference APP_KEY, database credentials, and API tokens; store them in environment variables or a secrets manager, never in committed .env files or config defaults. | ✓Rules reference Rails credentials, database URLs, and API keys; store them in encrypted credentials or environment variables, never in committed source files. | ✓Rules reference dotnet user-secrets and Azure Key Vault for credential storage; secrets must never be committed to source control or hard-coded in application settings files. | — missing |
| Prerequisites | — none listed | — none listed | — none listed | — none listed |
| Install | — | — | — | — |
| Config | — | — | — | — |
| Citations | ||||
| Claim | Unclaimed | Unclaimed | Unclaimed | Unclaimed |
Signals
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.