laravel

A set of instructions for building PHP applications with Laravel, a web framework. It covers common application structure, database models, authentication, security, validation, and testing practices.

In plain words
What is it for?
Creating Laravel applications and APIs, defining database models and relationships, adding authentication, validating requests, and writing tests.
Why use it?
It gives developers conventions for organizing Laravel code and avoiding common problems such as inefficient database queries, weak input handling, and overly complicated controllers.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/usrrname/cursorrules/laravel
Any agent
npx skills add usrrname/cursorrules --skill laravel
Clone the repo
git clone --depth 1 https://github.com/usrrname/cursorrules

Made for: Claude Code, Codex.

Per session 8 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 372 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00008 $0.00372
Opus 5 $0.00004 $0.00186
Sonnet 5 $0.00002 $0.00074
Haiku 4.5 $0.00001 $0.00037

Measured 2d ago against content hash c79c8874172a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

laravel scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/laravel/SKILL.md · 81 lines

What it actually says

Laravel Skill

Build robust PHP applications with Laravel framework.

When to Use

  • Creating Laravel applications
  • Building APIs with Laravel
  • Writing Eloquent models
  • Implementing authentication

Critical Rules

Architecture

  • Follow MVC pattern
  • Use Service classes for business logic
  • Implement Repository pattern for data access
  • Use Form Request classes for validation
  • Keep controllers thin, models rich

Eloquent ORM

  • Use eager loading to avoid N+1 queries
  • Define relationships explicitly
  • Use accessors/mutators sparingly
  • Leverage query scopes
  • Use factories for testing

Security

  • Use Laravel's authentication system
  • Hash passwords with bcrypt
  • Use CSRF protection on forms
  • Sanitize user inputs
  • Use authorization gates/policies

Code Style

  • Follow PSR-12 coding standards
  • Use type hints
  • Leverage Laravel's helper functions
  • Write docblocks for complex methods
  • Use meaningful variable names

Examples

Good

class UserController extends Controller
{
    public function index(Request $request): JsonResponse
    {
        $users = User::with('posts')
            ->active()
            ->paginate(20);
            
        return response()->json($users);
    }
}

Bad

// N+1 query problem
$users = User::all();
foreach ($users as $user) {
    echo $user->posts->count(); // Query in loop
}
  • /mysql - Database patterns
  • /typescript - For API type definitions
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 81 lines · 8 tokens per session scan A c79c8874172a

Subscribe to this mod's changes

laravel is a skill published in the GitHub repository usrrname/cursorrules (10 stars, last pushed 4mo ago), licensed ISC. It adds 8 tokens to every session and 372 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.