PHPackages                             mindwingx/service-call-adapter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mindwingx/service-call-adapter

ActiveLibrary[API Development](/categories/api)

mindwingx/service-call-adapter
==============================

Laravel package designed to simplify the integration and communication with various microservices and third-party services.

v1.0.6(2y ago)117MITPHPCI passing

Since Jun 5Pushed 2y agoCompare

[ Source](https://github.com/mindwingx/service-call-adapter)[ Packagist](https://packagist.org/packages/mindwingx/service-call-adapter)[ RSS](/packages/mindwingx-service-call-adapter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (8)Used By (0)

Service Call Adapter
====================

[](#service-call-adapter)

The Service Call Adapter is a Laravel package designed to simplify the integration and communication with various microservices and third-party services.

### Features

[](#features)

- Generate new service calls with a simple command
- Easily set up and configure your services
- Allocate multiple services by customized condition
- Generated service calls are easy to access in the `app/ServiceCalls` directory

### Installation

[](#installation)

- You can install the Service Call Adapter package via Composer:

```
composer require mindwingx/service-call-adapter

```

### Usage

[](#usage)

- Generate a new service call using the following command:

```
php artisan sc:new
```

- To call the microservices or third-party endpoints, you can use the generated service calls. For example:

```
use Mindwingx\ServiceCallAdapter\ServiceCall;

try {
    $response = ServiceCall::handle()->yourServiceName(["dummy-payload"]);
} catch (\Exception $exception) {
    return $exception->getMessage();
}

return $response;
```

\*\* Note: You have to strictly use the service name of creating after the `handle()` method.

\*\* Customize and configure your services according to your specific needs.

### Documentation

[](#documentation)

To prepare the needed data/payload for requests, pass them as an array in the `yourServiceName` method. The payload will be passed to the related service via the `ServiceAdapter` and `ServiceCall` classes.

##### Service Adapter Class example

[](#service-adapter-class-example)

- You can create multiple instances of the `ServiceCall` class in the related `ServiceAdapter` class if you have different services with the same purpose. Handle them in the constructor of the ServiceAdapter class based on your conditions.

```
class DummyServiceAdapter implements ServiceCallAdapterInterface
{
    /**
     * @var ServiceCallInterface
     */
    private ServiceCallInterface $service;

    public function __construct()
    {
        /*
         * Note: you make multiple Service Call Classes and handle them here to
         * access by the related condition, etc.
         */

        $this->service = new FirstServiceCall();
    }

    /**
     * @throws GuzzleException
     */
    public function call(array $payload = []): ResponseInterface|array
    {
        return $this->service
            ->preparePayload($payload)
            ->getResult();
    }
}
```

##### Service Call Class example

[](#service-call-class-example)

- The GuzzleHttp is used as the HTTP driver. In the `getResult()` method, it returns the request-response as an `array`. You can replace `getArrayResponse()` with `getResponse()` to get the default Guzzle response.

```
class FirstServiceCall extends ServiceCallHandler
{

    public function preparePayload(array $payload = []): self
    {
        //todo: set service call details
        $this->setUrl('https://service-url.io/api')
             ->setMethod() //  default: GET
             ->setQuery([])
             ->setHeaders([])
             ->setBody($payload);

        return $this;
    }

    /**
     * @throws GuzzleException
     */
    public function getResult(): ResponseInterface|array
    {
        return $this->sendRequest()
                    ->getArrayResponse();
    }
}
```

- The generated service call will be available in the app/ServiceCalls directory.

### Contributing

[](#contributing)

Contributions are welcome! If you find any issues or have suggestions for improvement, please submit an issue or a pull request on the GitHub repository.

### License

[](#license)

The Service Call Adapter package is open-source software licensed under the MIT license.

### Credits

[](#credits)

The Service Call Adapter package is developed and maintained by Milad Roudgarian.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~36 days

Recently: every ~0 days

Total

7

Last Release

855d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6de19f69954be41a43138bbc09937184e2428f49666237174414bcfb874d816?d=identicon)[mindwingx](/maintainers/mindwingx)

---

Top Contributors

[![mindwingx](https://avatars.githubusercontent.com/u/40317952?v=4)](https://github.com/mindwingx "mindwingx (9 commits)")

---

Tags

laravelmicroservicesService CallService Call Adapter

### Embed Badge

![Health badge](/badges/mindwingx-service-call-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/mindwingx-service-call-adapter/health.svg)](https://phpackages.com/packages/mindwingx-service-call-adapter)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[flat3/lodata

OData v4.01 Producer for Laravel

96320.9k](/packages/flat3-lodata)[laravel-freelancer-nl/laravel-index-now

Alert search engines of content changes.

5212.1k](/packages/laravel-freelancer-nl-laravel-index-now)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
