laravel-best-practices

Apply Laravel best practices across controllers, models, migrations, and Eloquent queries.

Updated May 29, 2026
One-click install
npx skills add https://github.com/alimarchal/school --skill laravel-best-practices-alimarchal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-best-practices
Source: https://github.com/alimarchal/school/tree/main/.agents/skills/laravel-best-practices
Command: npx skills add https://github.com/alimarchal/school --skill laravel-best-practices-alimarchal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel projects often drift from best practices, leading to maintainability issues, security gaps, and performance problems as teams add controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. This Skill provides a consistent framework to apply Laravel patterns across codebases, reducing technical debt and speeding up onboarding.

Core Features & Use Cases

  • Guides consistency across controllers, models, migrations, requests, policies, jobs, commands, services, and queries.
  • Addresses N+1 queries, caching strategies, authorization, validation, error handling, queue configuration, and route architecture.
  • Supports code reviews, refactoring, and architectural decisions to align code with Laravel standards.

Quick Start

Audit your Laravel codebase and apply the documented best-practice patterns.

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 Eloquent N+1 query problems in my Laravel application?

To fix Laravel N+1 query problems, apply best-practice Eloquent patterns like eager loading relationships to optimize database queries. This ensures consistent code quality and prevents performance bottlenecks across your application modules.

What's the best way to structure controllers, services, and models in Laravel?

Structuring Laravel controllers, services, and models requires applying consistent architectural patterns across your codebase. Following a pragmatic framework aligned with Laravel's ecosystem accelerates maintainable development and reduces technical debt during team onboarding.

How do I prevent security gaps during Laravel code reviews and refactoring?

Preventing security gaps during Laravel code reviews involves applying guardrails against insecure patterns in authorization, validation, and route architecture. Consistent best-practice patterns ensure maintainability across policies, requests, and service classes.

Does this Laravel best-practices framework apply to queued jobs and scheduled commands?

Yes, the Laravel best-practices framework applies to queued jobs and scheduled commands. It guides consistency across commands, jobs, and queue configuration, addressing caching strategies and error handling to ensure reliable execution.

Can I use these Laravel best-practices to audit an existing codebase?

Yes, you can use these Laravel best-practices to audit an existing codebase. The framework provides a structured approach to identify inconsistencies across migrations, policies, and queries, reducing technical debt and speeding up onboarding.