laravel-best-practices
Skill by nunomaduro
Applies Laravel best practices when writing, reviewing, or refactoring Laravel PHP code. Covers Eloquent, queries, caching, validation, queues, security and testing. Aimed at developers working on Laravel backends.
Install laravel-best-practices
Built from the published package, never by AI.
git clone --depth 1 https://github.com/nunomaduro/laravel-starter-kit-inertia-vue /tmp/laravel-starter-kit-inertia-vue && mkdir -p ~/.claude/skills && cp -r /tmp/laravel-starter-kit-inertia-vue/.junie/skills/laravel-best-practices ~/.claude/skills/laravel-best-practicesRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/nunomaduro/laravel-starter-kit-inertia-vue /tmp/laravel-starter-kit-inertia-vue && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/laravel-starter-kit-inertia-vue/.junie/skills/laravel-best-practices ~/.gemini/antigravity-cli/skills/laravel-best-practicesAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install laravel-best-practices in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
laravel-best-practices is an agent skill published by nunomaduro under an MIT license. It tells an AI assistant how to write, review and refactor Laravel PHP code. The skill is organised into 19 topic areas, each with a rules file, covering database performance, security, caching, Eloquent, validation, configuration, testing, queues, routing, the HTTP client, events, error handling, scheduling, architecture, migrations, collections, Blade views and style.
Before applying any rule, the assistant is told to check the existing codebase and follow its patterns, since consistency matters more than theory. Each rule explains what to do and why, ordered by impact. For exact API syntax, the skill points to search-docs. It is aimed at developers and reviewers working on Laravel backend code.
Written from the project's SKILL.md and checked against it.
What it can do
- Database performanceCovers N+1 prevention, eager loading, chunking and indexing for Eloquent queries.
- SecurityCovers fillable or guarded models, policies, output escaping and file upload checks.
- CachingCovers Cache::remember, flexible caching, cache tags and locks for race conditions.
- Eloquent patternsCovers relationship types, local and global scopes, and attribute casts.
- Validation and formsCovers Form Request classes and using validated() instead of all().
- Queue and job patternsCovers retry_after and timeout settings, unique jobs and implementing failed().
- Routing and controllersCovers implicit route model binding, resource routes and short controller methods.
- HTTP clientCovers explicit timeouts, retries with backoff, response checks and concurrent pools.
- Error handlingCovers report and render on exceptions, ShouldntReport and JSON rendering for APIs.
- MigrationsCovers constrained foreign keys, indexes in migrations and reversible down() methods.
What you need
- A Laravel PHP codebase
- The search-docs tool for checking API syntax
Try asking
- Review this Laravel controller for N+1 queries and missing eager loading.
- Refactor this inline validation into a Form Request class.
- Check this migration and add the indexes and foreign keys it needs.
Good to know
- Rules are defaults and do not override patterns already used in the codebase.
- Exact API syntax should be checked with search-docs for the installed Laravel version.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .junie/skills/laravel-best-practices/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to laravel-best-practices
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
laravel-best-practices: common questions
Does this skill work with any Laravel version?
The source does not list supported versions. It says to verify API syntax with search-docs for the installed Laravel version.
Will it override my project's existing coding patterns?
No. The source says to check existing patterns first and follow them, and the rules apply only when no pattern exists yet.
What areas of Laravel does it cover?
It covers 19 areas, including database performance, security, caching, queues, testing, routing, migrations and code style.
How do I install laravel-best-practices?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is laravel-best-practices free?
The code is public, but no licence file was found, so check the repository before commercial use.
Is laravel-best-practices safe to use?
It scores 78 of 100. Grades: maintenance A, licence F, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to laravel-best-practices?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
