laravel-best-practices

Review Laravel PHP code for best practices and performance optimization.

Updated Sep 25, 2025
One-click install
npx skills add https://github.com/angelgarciasolorzano/social-hub --skill laravel-best-practices-angelgarciasolorzano
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-best-practices
Source: https://github.com/angelgarciasolorzano/social-hub/tree/main/.agents/skills/laravel-best-practices
Command: npx skills add https://github.com/angelgarciasolorzano/social-hub --skill laravel-best-practices-angelgarciasolorzano

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill provides guidance for developers working with Laravel PHP code, helping to prevent common pitfalls and optimize performance.

Core Features & Use Cases

  • Best Practices for Laravel Code: Offers guidelines for controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries.
  • Performance Optimization: Identifies potential performance issues such as N+1 queries and suggests caching strategies.
  • Security Patterns: Covers secure coding practices, including input validation, output escaping, and proper handling of secrets.
  • Use Case: When developing Laravel applications, use this Skill to review and refactor code to ensure it follows best practices.

Quick Start

Apply the laravel-best-practices skill to your Laravel codebase to review and optimize it according to the guidelines.

Frequently Asked Questions about laravel-best-practices

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

FAQPage Schema
How do I review Laravel code for best practices and performance issues?

To review Laravel code for best practices, analyze controllers, models, and Eloquent queries against established guidelines. This process identifies performance issues like N+1 queries and suggests caching strategies to optimize backend PHP application efficiency.

What are the most common Laravel performance tuning issues to look for during refactoring?

Laravel performance tuning targets N+1 query problems in Eloquent and inefficient data retrieval. Refactoring resolves these issues by applying proper caching strategies and optimizing backend PHP code to meet efficiency guidelines.

Does this Laravel code review guidance cover security patterns and input validation?

Yes, Laravel code review guidance covers security patterns including secure coding practices. It specifically addresses proper handling of secrets, input validation, and output escaping to ensure your backend PHP application remains secure.

Can I use these best practices for all Laravel backend PHP code tasks?

Yes, you can apply these best practices to all tasks involving Laravel backend PHP code. The guidelines cover refactoring controllers, models, form requests, policies, jobs, scheduled commands, and service classes.

What is the best way to optimize Laravel Eloquent queries?

The best way to optimize Laravel Eloquent queries is to identify and resolve N+1 query issues. Following Laravel best practices involves using efficient data retrieval methods and applying caching strategies during code review and refactoring.