laravel-patterns

Provide Laravel 11+ development patterns for routing, Eloquent, queues, and testing.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/ps-carvalho/spavn-agents --skill laravel-patterns-ps-carvalho
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-patterns
Source: https://github.com/ps-carvalho/spavn-agents/tree/main/.opencode/skills/laravel-patterns
Command: npx skills add https://github.com/ps-carvalho/spavn-agents --skill laravel-patterns-ps-carvalho

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide and best practices for building robust and maintainable applications using Laravel 11+, addressing common challenges in modern PHP development.

Core Features & Use Cases

  • Structured Project Layout: Understand and implement recommended directory structures for clarity and scalability.
  • Service Container & DI: Leverage Laravel's powerful dependency injection for cleaner code.
  • Eloquent ORM Best Practices: Master relationships, scopes, accessors, and observers for efficient data management.
  • API & Web Routing: Implement best practices for API and web route definitions, including resource controllers and route model binding.
  • Middleware & Validation: Utilize middleware pipelines and form requests for robust request handling and validation.
  • Queues & Broadcasting: Implement background job processing and real-time features.
  • Testing Strategies: Write effective feature and unit tests using Pest or PHPUnit.
  • Performance Optimization: Learn techniques to ensure your Laravel applications run efficiently.

Quick Start

Use the laravel-patterns skill to generate a basic structure for a new Laravel 11+ API endpoint, including controller, request, and resource files.

Frequently Asked Questions about laravel-patterns

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

FAQPage Schema
What are the best practices for structuring a scalable Laravel 11 application?

Laravel 11 best practices for scalable applications involve implementing a recommended directory structure, leveraging the service container for dependency injection, and using Eloquent ORM effectively to ensure maintainable PHP development.

How do I implement API routing and resource controllers in Laravel 11?

To implement API routing in Laravel 11, use best practices for API route definitions including resource controllers and route model binding to efficiently manage your web application endpoints and data flow.

What's the best way to handle validation and middleware in Laravel?

The best way to handle validation in Laravel is to utilize middleware pipelines and form requests, providing robust request handling and validation logic directly within your PHP application architecture.

How do I write effective feature and unit tests for Laravel applications?

Writing effective feature and unit tests for Laravel applications requires utilizing testing strategies with Pest or PHPUnit to validate Eloquent ORM relationships, service container logic, and API endpoints.

Do I need to understand PHP and Laravel fundamentals before using these development patterns?

Yes, you need a solid understanding of PHP and the Laravel framework before implementing these development patterns, as they cover advanced architectural challenges like Eloquent ORM, broadcasting, and queues.