laravel-best-practices

Codify Laravel coding best practices for backend PHP codebases.

Updated Jun 8, 2025
One-click install
npx skills add https://github.com/noartem/kawa --skill laravel-best-practices-noartem
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-best-practices
Source: https://github.com/noartem/kawa/tree/main/ui/.agents/skills/laravel-best-practices
Command: npx skills add https://github.com/noartem/kawa --skill laravel-best-practices-noartem

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel projects often suffer from inconsistent patterns, excessive database queries, security pitfalls, and tangled architectures. This Skill provides a curated collection of guidelines and examples to standardize Laravel backend development across controllers, models, migrations, policies, jobs, and services.

Core Features & Use Cases

  • Enforce consistent Eloquent patterns, including correct relationship types, proper casts, and scoped queries to reduce bugs.
  • Promote performance and security by guiding eager loading, indexing, validation, and safe output escaping.
  • Facilitate rapid, safe code reviews and refactoring by presenting actionable rules for common Laravel codebases and architectures.

Quick Start

Audit the codebase and apply the documented Laravel best practices to align controllers, models, migrations, and tests with the standard 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 enforce Laravel best practices during a code review?

Enforce Laravel best practices during code reviews by applying curated rules for Eloquent relationships, eager loading, validation, and routing. This identifies inconsistent patterns and security pitfalls to standardize backend PHP projects.

What's the best way to refactor Eloquent queries to reduce excessive database loads?

Refactor Eloquent queries to reduce excessive database loads by applying scoped queries, proper casts, and eager loading guidelines. This mitigates the N+1 query problem and aligns models with standard Laravel patterns.

How do I secure Laravel migrations and output escaping?

Secure Laravel migrations and output escaping by following actionable rules for safe output generation and database indexing. This guides developers in avoiding security pitfalls and standardizing validation across the codebase.

Can I standardize Laravel controller and service architecture for backend development?

Standardize Laravel controller and service architecture by applying guidelines across controllers, models, policies, jobs, and services. This untangles architectures and codifies consistent patterns for robust PHP apps.

Does this Laravel refactoring skill require external dependencies or components?

No external dependencies or components are required. The skill uses internal metadata, optional scripts, references, and asset resources to drive discovery and apply rules for testing and routing without package installations.