PHPackages                             fragotesac/api-tools-rpc - 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. fragotesac/api-tools-rpc

ActiveLibrary[API Development](/categories/api)

fragotesac/api-tools-rpc
========================

Laminas Module for simplifying the creation of RPC services

1.9.1(11mo ago)05.2k↓43.9%2BSD-3-ClausePHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0

Since Jun 2Pushed 11mo agoCompare

[ Source](https://github.com/fragotesac/api-tools-rpc)[ Packagist](https://packagist.org/packages/fragotesac/api-tools-rpc)[ Docs](https://api-tools.getlaminas.org)[ RSS](/packages/fragotesac-api-tools-rpc/feed)WikiDiscussions 1.9.x Synced 1mo ago

READMEChangelog (1)Dependencies (12)Versions (2)Used By (2)

Laminas RPC
===========

[](#laminas-rpc)

[![Build Status](https://github.com/laminas-api-tools/api-tools-rpc/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/laminas-api-tools/api-tools-rpc/actions/workflows/continuous-integration.yml)

> ## 🇷🇺 Русским гражданам
>
> [](#-русским-гражданам)
>
> Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм.
>
> У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую.
>
> Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите "Нет войне!"
>
> ## 🇺🇸 To Citizens of Russia
>
> [](#-to-citizens-of-russia)
>
> We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.
>
> One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.
>
> You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"

Introduction
------------

[](#introduction)

Module for implementing RPC web services in Laminas.

Enables:

- defining controllers as PHP callables.
- creating a whitelist of HTTP request methods; requests outside the whitelist will return a `405 Method Not Allowed` response with an `Allow` header indicating allowed methods.

Requirements
------------

[](#requirements)

Please see the [composer.json](composer.json) file.

Installation
------------

[](#installation)

Run the following `composer` command:

```
$ composer require laminas-api-tools/api-tools-rpc
```

Alternately, manually add the following to your `composer.json`, in the `require` section:

```
"require": {
    "laminas-api-tools/api-tools-rpc": "^1.3"
}
```

And then run `composer update` to ensure the module is installed.

Finally, add the module name to your project's `config/application.config.php` under the `modules`key:

```
return [
    /* ... */
    'modules' => [
        /* ... */
        'Laminas\ApiTools\Rpc',
    ],
    /* ... */
];
```

> ### laminas-component-installer
>
> [](#laminas-component-installer)
>
> If you use [laminas-component-installer](https://github.com/laminas/laminas-component-installer), that plugin will install api-tools-rpc as a module for you.

Configuration
=============

[](#configuration)

### User Configuration

[](#user-configuration)

This module uses the top-level configuration key of `api-tools-rpc`.

#### Key: Controller Service Name

[](#key-controller-service-name)

The `api-tools-rpc` module uses a mapping between controller service names with the values being an array of information that determine how the RPC style controller will behave. The key should be a controller service name that also matches a controller service name assigned to a route in the `router` configuration.

Inside this key, the following sub-keys are required:

- `http_methods`: for configuring what methods this RPC service controller can respond to. This also is used for populating the `Allow` response header for this service.
- `route_name`: for linking back to a particular route. This is especially useful when RPC routes need to build links as part of their response.
- `callable` (optional): utilized to specify a callable that will be invoked at dispatch time. At dispatch time, these callables are typically wrapped in an instance of `Laminas\ApiTools\Rpc\RpcController`, which is a dispatchable action controller.

Example:

```
'api-tools-rpc' => [
    'Application\Controller\LoginController' => [
        'http_methods' => ['POST'],
        'route_name'   => 'api-login',
        'callable'     => 'Application\Controller\LoginController::process',
    ],
],
```

### System Configuration

[](#system-configuration)

The following configuration ensures this module operates properly in the context of a Laminas application:

```
'controllers' => [
    'abstract_factories' => [
        'Laminas\ApiTools\Rpc\Factory\RpcControllerFactory',
    ],
],
```

Laminas Events
==============

[](#laminas-events)

### Listeners

[](#listeners)

#### Laminas\\ApiTools\\Rpc\\OptionsListener

[](#laminasapitoolsrpcoptionslistener)

This listeners is registered to the `MvcEvent::EVENT_ROUTE` event with a priority of `-100`. It is responsible for ensuring the HTTP response to an `OPTIONS` request for the given RPC service includes the properly configured and allowed HTTP methods in the `Allow` header. This uses the configuration from the `http_methods` key of the `api-tools-rpc` service configuration for the matching service. Additionally, it verifies if the incoming request method is in the configured `http_methods` for the RPC service, and, if not, returns a `405 Method Not Allowed` response with a populated `Allow` header.

Laminas Services
================

[](#laminas-services)

### Models

[](#models)

#### Laminas\\ApiTools\\Rpc\\ParameterMatcher

[](#laminasapitoolsrpcparametermatcher)

This particular model is used and is useful for taking a callable and a set of named parameters, and determining which ones can be used as arguments to the callable.

### Controller

[](#controller)

#### Laminas\\ApiTools\\Rpc\\RpcController

[](#laminasapitoolsrpcrpccontroller)

This controller is used to wrap a callable registered as an RPC service in order to make it a Laminas dispatchable.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance50

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.8% 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 ~0 days

Total

2

Last Release

350d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1095778?v=4)[Francis Gonzales](/maintainers/FraGoTe)[@FraGoTe](https://github.com/FraGoTe)

---

Top Contributors

[![weierophinney](https://avatars.githubusercontent.com/u/25943?v=4)](https://github.com/weierophinney "weierophinney (134 commits)")[![michalbundyra](https://avatars.githubusercontent.com/u/7423207?v=4)](https://github.com/michalbundyra "michalbundyra (21 commits)")[![ralphschindler](https://avatars.githubusercontent.com/u/76674?v=4)](https://github.com/ralphschindler "ralphschindler (11 commits)")[![boesing](https://avatars.githubusercontent.com/u/2189546?v=4)](https://github.com/boesing "boesing (9 commits)")[![rnd-cosoft](https://avatars.githubusercontent.com/u/57006314?v=4)](https://github.com/rnd-cosoft "rnd-cosoft (3 commits)")[![geerteltink](https://avatars.githubusercontent.com/u/9497586?v=4)](https://github.com/geerteltink "geerteltink (3 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (3 commits)")[![ezimuel](https://avatars.githubusercontent.com/u/475967?v=4)](https://github.com/ezimuel "ezimuel (2 commits)")[![xjchengo](https://avatars.githubusercontent.com/u/4819996?v=4)](https://github.com/xjchengo "xjchengo (1 commits)")[![darckking](https://avatars.githubusercontent.com/u/10863497?v=4)](https://github.com/darckking "darckking (1 commits)")[![kersysgediminas](https://avatars.githubusercontent.com/u/51697762?v=4)](https://github.com/kersysgediminas "kersysgediminas (1 commits)")[![lukash82](https://avatars.githubusercontent.com/u/5096284?v=4)](https://github.com/lukash82 "lukash82 (1 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (1 commits)")[![alexdenvir](https://avatars.githubusercontent.com/u/1412074?v=4)](https://github.com/alexdenvir "alexdenvir (1 commits)")

---

Tags

laminasrpcmoduleapi-tools

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/fragotesac-api-tools-rpc/health.svg)

```
[![Health](https://phpackages.com/badges/fragotesac-api-tools-rpc/health.svg)](https://phpackages.com/packages/fragotesac-api-tools-rpc)
```

###  Alternatives

[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)

PHPackages © 2026

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