Laravel Best PracticesBLOCK
Laravel-focused MCP server for augmenting your AI powered local development experience.
Overview
Laravel-focused MCP server for augmenting your AI powered local development experience.
9cb3b7a9785fOBSERVED · 2026-10-20Host compatibility
What the documentation claims. We have not run a compatibility test.
| Host | Status | Notes |
|---|---|---|
| cursor | mentioned |
What it tells the agent
The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.
--- name: laravel-best-practices description: "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." license: MIT metadata: author: laravel --- # 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 1. Check the changed files, nearby code, project configuration, and relevant tests for established patterns. Deviate only for a correctness or security defect, and call the deviation out. 2. Map every affected concern to the rule index below. Read each mapped rule file before editing. Skip unrelated rule files. 3. Make the smallest coherent change. Keep the application's architecture and naming instead of introducing a second pattern for the same job. 4. Verify version-sensitive Laravel APIs for the installed version with `search-docs`, or inspect the installed framework when `search-docs` is unavailable. 5. Run the narrowest relevant tests first, then the project's formatting and static-analysis checks when the change warrants them. 6. Re-read the diff against every mapped rule before finishing. ## Rule index Cross-cutting changes often need more than one rule file. | Concern | Read | | --- | --- | | Query count, eager loading, indexes, large datasets | [`rules/db-performance.md`](rules/db-performance.md) | | Subqueries, aggregates, complex ordering and query plans | [`rules/advanced-queries.md`](rules/advanced-queries.md) | | Models, relationships, scopes, casts | [`rules/eloquent.md`](rules/eloquent.md) | | Authentication, authorization, input safety, secrets, uploads | [`rules/security.md`](rules/security.md) | | Form Requests and validation rules | [`rules/validation.md`](rules/validation.md) | | Controllers, route binding, resources, middleware | [`rules/routing.md`](rules/routing.md) | | Schema changes, columns, foreign keys, indexes | [`rules/migrations.md`](rules/migrations.md) | | Jobs, retries, uniqueness, batches, Horizon | [`rules/queue-jobs.md`](rules/queue-jobs.md) | | Cache lifetime, invalidation, locks, memoization | [`rules/caching.md`](rules/caching.md) | | Outbound requests, retries, timeouts, fakes | [`rules/http-client.md`](rules/http-client.md) | | Exceptions, reporting, rendering, log context | [`rules/error-handling.md`](rules/error-handling.md) | | Events and notifications | [`rules/events-notifications.md`](rules/events-notifications.md) | | Mailables and mail assertions | [`rules/mail.md`](rules/mail.md) | | Scheduled tasks and overlap protection | [`rules/scheduling.md`](rules/scheduling.md) | | Collections, lazy iteration, bulk operations | [`rules/collections.md`](rules/collections.md) | | Blade components, attributes, composers | [`rules/blade-views.md`](rules/blade-views.md) | | Environment values and application configuration | [`rules/config.md`](rules/config.md) | | Tests: coverage, factories, fakes, and assertions | the `testing-best-practices` skill | | Naming, helpers, file boundaries, PHP style | [`rules/style.md`](rules/style.md) | | Actions, services, dependencies, application structure | [`rules/architecture.md`](rules/architecture.md) | ## Decision rules - Prefer framework features and existing application abstractions over new helpers or dependencies. - Avoid speculative abstractions. Extract code when it creates a clear domain boundary, removes meaningful duplication, or makes behavior independently testable. - Keep database access out of Blade views and prevent hidden N+1 queries across controllers, resources, jobs, and serialization.
Trust audit
BLOCKgrade D · trust 69/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | FAIL |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- declared (1 observation(s))
- Dependencies
- pinned
- Secrets in source
- none-found
Findings (1)
Laravel restricts `runInBackground()` to tasks scheduled with `command()` and `exec()`. It is not available for scheduled closures. Give background processes logging and failure monitoring.
Gates applied: no_behavioural_pass.
9cb3b7a9785ffull audit observations/trust-audit/skill/laravel__laravel-best-practices.json · Report an issue / request a re-scanAudit history
Every audit this skill has had.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-20 | 9cb3b7a9785f | BLOCK | D | 69 | first audit |
Questions
What does the laravel-best-practices — laravel/boost skill do?
Laravel-focused MCP server for augmenting your AI powered local development experience.
Is laravel-best-practices — laravel/boost safe to install?
No — not without reading the findings first. The audit graded it D (69/100) and found 1 critical or high issue in the source. Each one is listed on this page with the file and line it is on.
What can laravel-best-practices — laravel/boost access on my machine?
The audit observed that it runs shell commands. Each of those is consistent with what it says it does. Secrets in the source: none found.
Which assistants does laravel-best-practices — laravel/boost work with?
Its documentation mentions cursor. That is what the text claims, not a compatibility test we ran.
How current is this page?
The grade is for one exact copy of the source (9cb3b7a9785f), read on 2026-10-20. The repository is watched, and a new audit runs when it changes — this is the first audit.
Add this badge to your README
Shows this page's audit result and links back to it. It updates when the audit does.
[](https://modelsatlas.com/skills/laravel/laravel-best-practices/)
Not your listing, or something out of date? Claim or update your listing.