laravel-best-practices

Standardize Laravel 13 architecture with controllers, models, services, and API patterns.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/mkopcic/md-solutions.hr-racuni-app --skill laravel-best-practices-mkopcic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-best-practices
Source: https://github.com/mkopcic/md-solutions.hr-racuni-app/tree/main/.github/skills/laravel-best-practices
Command: npx skills add https://github.com/mkopcic/md-solutions.hr-racuni-app --skill laravel-best-practices-mkopcic

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a disciplined framework of Laravel 13 conventions and patterns to reduce architectural drifts, improve maintainability, and accelerate development across teams.

Core Features & Use Cases

  • Service classes for business logic separation and testability
  • Eloquent best practices: eager loading, scopes, relationships, and pruning
  • Validation, form requests, API resources, and repository DTO patterns to standardize APIs
  • Guidelines for structuring Laravel applications and routing to ensure consistency

Quick Start

Review the Laravel 13 Best Practices guide and implement the recommended patterns in your Laravel project to align controllers, models, services, and API layers with the standard.

Frequently Asked Questions about laravel-best-practices

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

FAQPage Schema
What's the best way to structure Laravel 13 controllers and services for scalability?

The best way to structure Laravel 13 controllers and services for scalability involves using service classes to separate business logic from controllers, ensuring testability and maintainability across your application layers.

How do I prevent N+1 query problems with Eloquent in Laravel?

To prevent N+1 query problems with Eloquent in Laravel, apply eager loading when retrieving models and use scopes alongside proper relationship definitions to optimize database access patterns efficiently.

When do I need DTOs and API resources in Laravel API development?

You need DTOs and API resources in Laravel API development when standardizing API response structures, ensuring consistent data transformation, and separating data transfer logic from your core business models.

Does this Laravel best practices guide cover form requests and validation rules?

Yes, this Laravel best practices guide covers form requests and validation rules, providing standardized patterns to handle data validation consistently across your Laravel 13 project endpoints.

Can I use repository patterns with Eloquent models in Laravel 13?

Yes, you can use repository patterns with Eloquent models in Laravel 13 to abstract data access logic, complementing DTO patterns to standardize APIs and maintain clean architecture separation.

How to organize Laravel migrations and routing to ensure architectural consistency?

To organize Laravel migrations and routing for architectural consistency, follow structured guidelines for application organization, ensuring consistent patterns across database schemas and endpoint definitions throughout the project.