laravel-best-practices

Enforce Laravel backend best practices across controllers, models, migrations, and testing.

Updated Dec 19, 2025
One-click install
npx skills add https://github.com/beardcoder/mens-circle --skill laravel-best-practices-beardcoder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-best-practices
Source: https://github.com/beardcoder/mens-circle/tree/main/.agents/skills/laravel-best-practices
Command: npx skills add https://github.com/beardcoder/mens-circle --skill laravel-best-practices-beardcoder

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel projects often suffer from inconsistent patterns, duplicated logic, and maintenance overhead as teams scale. This Skill provides a structured set of rules and conventions to guide code construction, reviews, and architectural decisions across controllers, models, policies, jobs, routes, and testing.

Core Features & Use Cases

  • Enforces consistent Eloquent patterns, scopes, and relations to reduce N+1 queries and improve readability.
  • Standardizes routing, controllers, form requests, and policies to speed up onboarding and code review.
  • Guides performance, security, validation, and testing practices to improve reliability and maintainability.

Quick Start

Audit a Laravel codebase and apply the documented best practices to refactor code and align with the team's standards.

Frequently Asked Questions about laravel-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent N+1 queries and improve Laravel code quality during refactoring?

Prevent N+1 queries by enforcing consistent Eloquent patterns, scopes, and relations across models and controllers, improving readability. Apply these structured rules during code reviews and refactoring to systematically resolve query performance bottlenecks.

What are the best practices for structuring Laravel controllers, form requests, and policies?

Standardize Laravel controllers, form requests, and policies by enforcing uniform authorization and validation patterns. Structuring routes and policies this way speeds up team onboarding, reduces duplicated logic, and ensures consistent architectural decisions across the project.

How do I configure Laravel queues and caching for better application architecture?

Configure Laravel queues and caching by applying structured conventions to jobs and routes. Implementing these architecture decisions ensures reliable background processing, improves performance, and maintains code consistency across scaling projects.

Does this approach require existing Laravel testing practices to be effective?

No, it guides testing practices directly. It standardizes Laravel testing alongside validation, security, and queue configuration to improve reliability, ensuring uniform patterns are applied even if your current test coverage or architecture is incomplete.

Can I use these Laravel architecture patterns to audit an existing codebase?

Yes, you can audit a Laravel codebase by applying these documented best practices. It identifies inconsistent patterns, duplicated logic, and maintenance overhead, then guides code construction and refactoring to align with team standards.