laravel-conventions

Enforce Laravel 10+ conventions for Eloquent, controllers, validation, and testing.

8|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/zb-ss/opencode-workflows --skill laravel-conventions-zb-ss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-conventions
Source: https://github.com/zb-ss/opencode-workflows/tree/main/skill/laravel-conventions
Command: npx skills add https://github.com/zb-ss/opencode-workflows --skill laravel-conventions-zb-ss

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides guidance on adhering to Laravel's established conventions and best practices, ensuring cleaner, more maintainable, and efficient code.

Core Features & Use Cases

  • Eloquent ORM: Learn optimal ways to interact with your database.
  • Controller Design: Understand how to keep controllers lean and delegate logic.
  • Validation: Implement robust data validation using Form Requests.
  • API Resources: Structure your API responses effectively.
  • Service Layer: Organize business logic outside of controllers.
  • Testing: Write effective feature tests for your Laravel applications.
  • Use Case: A developer starting a new Laravel project can use this Skill to quickly set up their application following industry-standard patterns, avoiding common pitfalls.

Quick Start

Follow the Laravel conventions outlined in this skill for your project structure and Eloquent usage.

Frequently Asked Questions about laravel-conventions

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

FAQPage Schema
What are the best practices for structuring controllers and business logic in Laravel?

Laravel best practices recommend keeping controllers lean by delegating business logic to a dedicated service layer. This ensures controllers focus on HTTP request handling while maintaining clean, organized, and maintainable application code.

How do I optimize Eloquent ORM queries to prevent performance issues?

To optimize Eloquent ORM performance, implement eager loading to avoid the N+1 query problem. Following Laravel conventions ensures efficient database interactions and robust application development across your ORM queries.

What is the recommended way to handle data validation in a Laravel application?

The recommended way to handle data validation in a Laravel application is using Form Requests. This approach enforces robust validation rules by encapsulating request validation logic outside of controllers.

Does this Laravel conventions guidance apply to my existing Laravel 10+ project?

Yes, these Laravel conventions explicitly enforce best practices for Laravel 10+ applications. Whether starting a new project or refactoring, it guides directory structure, API resources, and testing methodologies for robust development.

How do I structure API responses effectively when building a Laravel backend?

To structure API responses effectively, use Laravel API Resources. This convention wraps Eloquent models and collections into standardized JSON responses, separating data transformation from core business logic.