laravel-best-practices

Apply Laravel architectural and coding standards for performance, security, and maintainability.

Updated Dec 20, 2024
One-click install
npx skills add https://github.com/MrEddie7/DS_AMS_ETEC --skill laravel-best-practices-mreddie7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-best-practices
Source: https://github.com/MrEddie7/DS_AMS_ETEC/tree/main/3%20ano/Atividades/2%20Bimestre/PW%20ll/breeze-etec/.agents/skills/laravel-best-practices
Command: npx skills add https://github.com/MrEddie7/DS_AMS_ETEC --skill laravel-best-practices-mreddie7

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of maintaining high-quality, performant, and secure Laravel applications by providing a centralized, authoritative source for industry-standard coding patterns and architectural decisions.

Core Features & Use Cases

  • Performance Optimization: Provides actionable rules for preventing N+1 queries, implementing efficient caching strategies, and optimizing database interactions.
  • Security & Architecture: Offers guidance on implementing robust authorization, secure form handling, and clean, maintainable code structures using Action classes and dependency injection.
  • Use Case: Use this Skill when refactoring a legacy controller to improve performance, or when starting a new feature to ensure your implementation follows the established Laravel conventions for routing, validation, and testing.

Quick Start

Apply the laravel-best-practices skill to review the current controller implementation and suggest refactoring steps to improve performance and maintainability.

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 problems in my Laravel application?

Fix N+1 query problems in Laravel by applying optimized database interaction rules, utilizing eager loading patterns, and implementing efficient caching strategies to ensure performance and maintainability.

What is the best way to structure a legacy Laravel controller for better maintainability?

The best way to refactor a legacy Laravel controller involves implementing clean architectural standards using Action classes, dependency injection, secure form handling, and robust authorization to ensure consistent code structure.

Does this guide cover security hardening for PHP backend development?

Yes, it covers security hardening for PHP backend development by offering actionable guidance on robust authorization, secure form handling, and architectural coding standards to maintain secure Laravel applications.

How do I ensure my new Laravel feature follows official routing and testing conventions?

Ensure your new Laravel feature follows official conventions by applying established architectural patterns for routing, validation, and testing, guaranteeing consistent code structure and adherence to industry-standard coding practices.

When should I use Action classes and dependency injection in Laravel web development?

Use Action classes and dependency injection in Laravel web development when refactoring legacy code or building new features to achieve clean, maintainable code structures and satisfy consistent architectural standards.