laravel-best-practices

Enforce Laravel best practices for controllers, models, migrations, and routes.

Updated Nov 22, 2024
One-click install
npx skills add https://github.com/creamgod45/CGCloud --skill laravel-best-practices-creamgod45
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-best-practices
Source: https://github.com/creamgod45/CGCloud/tree/main/.agents/skills/laravel-best-practices
Command: npx skills add https://github.com/creamgod45/CGCloud --skill laravel-best-practices-creamgod45

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel projects often suffer from inconsistent patterns, security gaps, and maintainability issues as teams grow. This Skill provides a consolidated set of Laravel best practices to standardize code and review processes.

Core Features & Use Cases

  • Comprehensive guidance for controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries.
  • Practical rules that mitigate N+1 queries, caching pitfalls, authorization gaps, and routing or architectural anti-patterns.
  • Review checklists and refactoring guidance to bring existing Laravel codebases in line with established standards and scalable architecture.

Quick Start

Audit an existing Laravel project and begin applying the documented rules to improve code quality today.

Frequently Asked Questions about laravel-best-practices

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

FAQPage Schema
How do I fix N+1 query issues in Laravel Eloquent?

Fix Laravel N+1 query issues by applying eager loading rules to Eloquent models, mitigating performance bottlenecks through practical optimization guidance and refactoring examples provided by the skill.

What is the best way to structure Laravel controllers and services for maintainability?

Structure Laravel controllers and service classes for maintainability by enforcing consistent naming and architectural best practices, reducing bugs through standardized code review processes.

How do I enforce authorization and security controls in Laravel policies?

Enforce authorization and security controls in Laravel policies by applying rules-based guidance that mitigates authorization gaps and standardizes form request validation across backend PHP projects.

Does this Laravel best practices skill work for auditing existing backend PHP projects?

Yes, this Laravel best practices skill works for auditing existing backend PHP projects by providing review checklists and refactoring guidance to align codebases with scalable architecture standards.

When should I refactor Laravel migrations and routing to avoid architectural anti-patterns?

Refactor Laravel migrations and routing to avoid architectural anti-patterns when your project suffers from inconsistent patterns, security gaps, or maintainability issues as your team grows.

Can I use this skill to standardize Laravel jobs and queues?

Yes, you can use this skill to standardize Laravel jobs, queues, and scheduled commands by enforcing consistent naming conventions and performance optimizations across your backend architecture.