laravel avatar

Laravel Best Practices

This is a comprehensive reference for writing and reviewing Laravel code, covering everything from N+1 prevention and query optimization to queue configuration and error handling. What stands out is the "Consistency First" principle at the top: it explicitly tells you to match your codebase's existing patterns even if these rules suggest something different, which is the right call for real projects. The quick reference format makes it scannable when you're mid-task, and it goes deep on performance patterns like subquery techniques and compound indexes. Apply it when touching any Laravel backend code, from controllers and models to jobs and migrations. It assumes you know Laravel basics and focuses on decisions that actually matter at scale.

install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
11
skills.sh installs
2.4K
GitHub stars
3.7K
last updated
Aug 21, 2026

Install

$ npx -y skills add laravel/boost --skill laravel-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Files

Laravel best practices

Best practices for Laravel, organized as an index of rule files. Each rule file teaches what to do and why. For exact API syntax, verify with search-docs.

Consistency first

Before applying any rule, check what the application already does. Laravel offers several valid approaches. The best choice is the one the codebase already uses, even if another pattern would be better in theory. Inconsistency is worse than a suboptimal pattern.

Check sibling files and related controllers, models, or tests for established patterns. If one exists, follow it. Don't introduce a second way. These rules are defaults for when no pattern exists yet, not overrides.

How to apply

Sponsors

Details

Repository
github.com/laravel/boost
Categories
Backend & APIs, Security, Documentation, Code Review & Quality, Debugging, PHP & Laravel
First seen
Jun 3, 2026

More from laravel/boost

All 5
1asyrafhussin avatarlaravel-best-practicesasyrafhussin/agent-skillsLaravel 13 conventions and best practices. Use when creating controllers, models, migrations, validation, services, or structuring Laravel applications. Trigger2.4Kskills.sh installs
2lobehub avatarprlobehub/lobehubCreate a PR for the current branch (targets `canary` by default), including splitting one cross-layer branch into ordered stacked PRs so a lower layer (db / sha2.3Kskills.sh installs
3bmad-labs avatartypescript-e2e-testingbmad-labs/skillsE2E and integration testing for TypeScript/NestJS projects using Jest, supertest, and real infrastructure via Docker (Kafka, PostgreSQL, MongoDB, Redis) with th2.3Kskills.sh installs
4apollographql avatarapollo-connectorsapollographql/skillsGuide for integrating REST APIs into GraphQL supergraphs using Apollo Connectors with @source and @connect directives. Use this skill when the user: (1) mention2.3Kskills.sh installs
5ccxt avatarccxt-pythonccxt/ccxtCCXT cryptocurrency exchange library for Python developers. Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchan2.3Kskills.sh installs
6onmax avatarnuxthubonmax/nuxt-skillsUse when building NuxtHub v0.10.6 applications - provides database (Drizzle ORM with sqlite/postgresql/mysql), KV storage, blob storage, and cache APIs. Covers 2.3Kskills.sh installs