Laravel Ports and Adapters

•
137
•

Implements hexagonal architecture patterns to decouple Laravel applications from external vendor SDKs and services.

This skill guides Claude in implementing the Ports and Adapters (Hexagonal) architecture within Laravel applications, ensuring domain logic remains isolated from infrastructure details. It facilitates the creation of stable PHP interfaces (ports) and specific adapter implementations for third-party services like mailers, payment gateways, or cloud storage. By abstracting vendor-specific logic and centralizing dependency resolution in the composition edge, developers can easily swap providers or mock integrations for testing without touching the core business logic, leading to more maintainable and testable codebases.

Key Features

01Service Provider composition logic
02137 GitHub stars
03Provider-specific Adapter implementation
04Standardized Port (Interface) generation
05Vendor SDK decoupling
06Data normalization using DTOs

Use Cases

01Switching between email providers like SES and SendGrid without modifying business logic
02Maintaining a clean domain layer free from infrastructure-specific dependencies
03Creating mockable interfaces for complex external services to improve testing reliability