laravel-services

Create Laravel service layers with interchangeable drivers and Saloon HTTP clients.

1|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/nextplus896/durra-alaseel --skill laravel-services
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-services
Source: https://github.com/nextplus896/durra-alaseel/tree/main/.github/skills/claude-laravel/laravel-services
Command: npx skills add https://github.com/nextplus896/durra-alaseel --skill laravel-services

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill standardizes external API integrations in Laravel by providing a centralized service layer that enables multiple drivers and clean architecture.

Core Features & Use Cases

  • Manager-based service layer with multiple drivers to swap implementations easily.
  • Saloon-based HTTP clients via connectors for consistent external API communication.
  • Clear separation of concerns with Controllers, Managers, Drivers, and Requests for scalable integrations.
  • Useful for payments, emails, SMS, and other third-party services requiring interchangeable backends.

Quick Start

Configure a sample driver (Stripe) and call the manager to create a payment intent, e.g., Payment::driver('stripe')->createPaymentIntent(10000, 'usd').

Frequently Asked Questions about laravel-services

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

FAQPage Schema
How do I structure a Laravel service layer for multiple external API integrations?

A Laravel service layer for external APIs uses a Manager-based architecture with multiple swappable drivers to standardize integrations. This pattern centralizes connections and requests, allowing you to swap implementations for payments or emails without altering core application logic.

What is the manager pattern for interchangeable API drivers in Laravel?

The manager pattern in Laravel defines a central service class that dynamically selects driver implementations. It enables clean separation of concerns, allowing interchangeable backends like Stripe or NullDriver to be resolved at runtime via facades for consistent external API communication.

How do I test external API integrations in Laravel without hitting live services?

You test external API integrations deterministically by implementing an optional NullDriver within your service layer. Swapping the active driver to NullDriver during testing prevents live HTTP requests, ensuring your Saloon connectors and payment workflows execute safely in isolated environments.

Can I use Saloon HTTP connectors with a Laravel service layer for third-party APIs?

Yes, Saloon HTTP connectors integrate directly into a Laravel service layer to handle external API communication. They provide consistent request formatting and response handling across multiple drivers, ensuring scalable architecture for third-party services like SMS or payment gateways.

Does Laravel service layer architecture support swapping payment providers dynamically?

Yes, Laravel service layer architecture supports swapping payment providers dynamically using drivers. You can call the manager to specify a driver like Stripe, enabling interchangeable API implementations that process payments without requiring structural changes to your controllers.

When should I use a driver-based service layer instead of direct HTTP calls in Laravel?

Use a driver-based service layer when your project requires interchangeable API implementations for multiple providers. It replaces direct HTTP calls with modular architecture, providing testable facades and connectors that prevent vendor lock-in across payments, emails, and notifications.