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.zipInstalls 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.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
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| laravel-best-practices (this skill) | 0 | 5mo | Review | Intermediate |
| php-best-practices | 15 | 2mo | No flags | Beginner |
| woocommerce-code-review | 6 | 4mo | No flags | Intermediate |
| php-pro | 13 | 5mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
php-best-practices
HoangNguyen0403
PHP best practices, PSR standards, and code quality guidelines.
woocommerce-code-review
woocommerce
Review WooCommerce code changes for coding standards compliance. Use when reviewing code locally, performing automated PR reviews, or checking code quality.
php-pro
sickn33
Write idiomatic PHP code with generators, iterators, SPL data structures, and modern OOP features. Use PROACTIVELY for high-performance PHP applications.
php-guidelines-from-spatie
freekmurze
Describes PHP and Laravel guidelines provided by Spatie. These rules result in more maintainable, and readable code.
woocommerce-backend-dev
woocommerce
Add or modify WooCommerce backend PHP code following project conventions. Use when creating new classes, methods, hooks, or modifying existing backend code. **MUST be invoked before writing any PHP unit tests.**
woocommerce-dev-cycle
woocommerce
Run tests, linting, and quality checks for WooCommerce development. Use when running tests, fixing code style, or following the development workflow.