laravel-best-practices

Review Laravel codebases against established development best practices.

1|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/HubDigitalEPN/HubDigital --skill laravel-best-practices-hubdigitalepn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-best-practices
Source: https://github.com/HubDigitalEPN/HubDigital/tree/main/.ai/skills/laravel-best-practices
Command: npx skills add https://github.com/HubDigitalEPN/HubDigital --skill laravel-best-practices-hubdigitalepn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill unit provides a guide to applying best practices in Laravel development, helping developers write cleaner, more efficient, and secure code.

Core Features & Use Cases

  • Best Practice Implementation: Offers guidelines for controller, model, migration, form request, policy, job, scheduled command, service class, and Eloquent query development.
  • Performance Tips: Provides strategies for query optimization, caching, and memory management.
  • Security Best Practices: Covers input validation, output escaping, and handling of sensitive data.
  • Use Case: Ideal for developers looking to refine their Laravel codebase and ensure compliance with best practices.

Quick Start

Apply the Laravel Best Practices Skill to review your existing Laravel codebase and refactor it to follow established best practices.

Frequently Asked Questions about laravel-best-practices

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

FAQPage Schema
What are the best practices for Laravel security and input validation?

Laravel security best practices involve strict input validation via form requests, proper output escaping, and secure handling of sensitive data to prevent common vulnerabilities. This guide provides specific strategies for implementing these protections.

How do I optimize Laravel Eloquent queries for database performance?

Optimizing Laravel Eloquent queries involves applying specific patterns to prevent N+1 issues, reducing memory usage, and leveraging effective caching strategies. This guide provides actionable tips for query optimization and memory management.

Do I need advanced PHP knowledge to apply these Laravel development guidelines?

Yes, applying these Laravel development guidelines requires a solid foundation in PHP and the Laravel framework. The guide targets developers looking to refine their codebase with advanced architectural and performance patterns.

How do I refactor an existing Laravel codebase to follow best practices?

Refactoring an existing Laravel codebase involves reviewing controllers, models, and jobs against established guidelines for architecture and error handling. You can apply this guide to systematically update your code for better efficiency and security.

What is the best way to handle Laravel queue, job, and task scheduling patterns?

The best way to handle Laravel queue and job patterns is to follow established guidelines for scheduled commands and service classes. This guide covers proper task scheduling and error handling to ensure robust background processing.

When should I use specific Laravel caching and configuration best practices?

You should use Laravel caching and configuration best practices when optimizing application performance and managing memory. This guide provides strategies for when to apply caching mechanisms and how to structure configuration effectively.