LA

laravel-best-practices

Provides professional standards and best practices for writing maintainable and performant Laravel PHP code.

Install

mkdir -p .claude/skills/laravel-best-practices && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15126" && unzip -o skill.zip -d .claude/skills/laravel-best-practices && rm skill.zip

Installs to .claude/skills/laravel-best-practices

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization and security patterns, validation, error handling, queue and job configuration, route definitions, and architectural decisions. Also use for Laravel code reviews and refactoring existing Laravel code to follow best practices. Covers any task involving Laravel backend PHP code patterns.
605 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • →Prevent N+1 queries with eager loading
  • →Select only necessary columns in queries
  • →Index columns used in WHERE, ORDER BY, JOIN clauses
  • →Define `$fillable` or `$guarded` on every model
  • →Use Eloquent or query builder for user input
  • →Validate MIME type, extension, and size for file uploads

How it works

The skill provides a set of prioritized Laravel best practices across various domains like database performance, security, and Eloquent patterns, guiding code review and refactoring.

Inputs & outputs

You give it
Laravel PHP code (controllers, models, migrations, etc.)
You get back
Refactored or newly written Laravel code adhering to best practices

When to use laravel-best-practices

  • →Reviewing Laravel code quality
  • →Optimizing Eloquent queries
  • →Refactoring Laravel controllers and models

About laravel-best-practices

Enforces Laravel-specific coding patterns for models, controllers, and queries. Includes rules for database performance, security, and architectural consistency.

Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strateg

When not to use it

  • →When the application already has established patterns that contradict these rules
  • →When raw SQL with user input is intentionally used
  • →When `SELECT *` is explicitly required

Limitations

  • →The skill prioritizes existing application patterns over its own rules for consistency
  • →The skill does not provide exact API syntax, requiring verification with `search-docs`
  • →The skill covers Laravel backend PHP code patterns

How it compares

This skill offers structured, prioritized Laravel-specific best practices with explanations, providing a systematic approach to code quality that goes beyond general programming guidelines.

Compared to similar skills

laravel-best-practices side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
laravel-best-practices (this skill)05moReviewIntermediate
php-best-practices152moNo flagsBeginner
woocommerce-code-review64moNo flagsIntermediate
php-pro135moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry