laravel-best-practices

Apply Laravel 13 architectural and coding standards for controllers, models, migrations, and service layers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill addresses the challenge of maintaining scalable, clean, and performant Laravel applications by providing a standardized set of architectural and coding conventions.

Core Features & Use Cases

  • Architectural Guidance: Implements service classes, action classes, and DTOs to decouple business logic from controllers.
  • Database Optimization: Provides patterns for eager loading, query scopes, and repository usage to prevent performance bottlenecks.
  • Use Case: When building a new feature, use this skill to determine whether to use a service class or an action class, ensuring your code remains testable and follows modern Laravel 13 standards.

Quick Start

Use the laravel-best-practices skill to generate a service class structure for a new order processing feature.

Frequently Asked Questions about laravel-best-practices

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

FAQPage Schema
What is the best way to structure Laravel controllers and models for enterprise applications?

Laravel database optimization involves using eager loading, query scopes, and repository patterns to prevent performance bottlenecks. These standards ensure efficient database interaction and maintainable Eloquent queries within modern PHP applications.

How do I implement a service class for processing orders in Laravel 13?

Laravel best practices for enterprise applications require PHP 8.3 and Laravel 13. These standards apply to the development of controllers, models, migrations, and service layers, ensuring your codebase satisfies requirements for type safety and clean code.

When should I use action classes instead of service classes in Laravel architecture?

Repository usage in Laravel database interaction abstracts data access logic away from controllers and models. This pattern works synergistically with eager loading and query scopes to prevent performance bottlenecks and maintain clean architecture.

Does this Laravel refactoring approach support type safety in PHP 8.3?

Yes, this Laravel refactoring approach supports type safety in PHP 8.3 by enforcing clean code standards and architectural conventions. It applies modern PHP features to controllers, models, migrations, and service layers for robust enterprise applications.