PHPackages                             er1z/multi-api-platform-bundle - 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. er1z/multi-api-platform-bundle

AbandonedArchivedLibrary[API Development](/categories/api)

er1z/multi-api-platform-bundle
==============================

Provides an ability to create more than one API in single app

0.1.1(7y ago)62.2k—0%1MITPHP

Since Jan 7Pushed 7y ago1 watchersCompare

[ Source](https://github.com/er1z/multi-api-platform-bundle)[ Packagist](https://packagist.org/packages/er1z/multi-api-platform-bundle)[ RSS](/packages/er1z-multi-api-platform-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Multi-API-Platform
------------------

[](#multi-api-platform)

This Symfony's bundle is a solution to problem for having more than one API in single [API Platform](https://api-platform.com) instance. For example, you have an application's back-end that exposes resources for end-clients and you want to create an entrypoint for internal microservices.

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

[](#installation)

Issue

```
composer require er1z/multi-api-platform

```

Configuration
-------------

[](#configuration)

First, separate your structures. They have to be distinguished via namespace or implemented interface. Suppose we create two APIs: internal and external.

Usually I rely on DTOs (but it should work also for entities). Create two classes:

- `App\DTO\Internal\MyInternalStruct`
- `App\DTO\External\MyExternalStruct`

Then create `config/packages/multi_api_platform.yml` with following contents:

```
multi_api_platform:
  apis:
    internal:
      namespace: App\DTO\Internal
      #implements: App\My\MyInterface
      conditions: "request.query.has('is_internal')"
      debug_conditions: "request.query.has('is_internal')"
    external:
      namespace: App\DTO\External
      conditions: "true"
      debug_conditions: "true"

```

Either `namespace` or `implements` should be configured.

You must configure `conditions` for each API manually. This is an [expression](https://symfony.com/doc/current/components/expression_language.html)that restricts API access via HTTP using dynamic [route conditions](https://symfony.com/doc/current/routing/conditions.html).

Conditions are not pre-defined in order to obligate you exposing particular API carefully. If you want to expose an API as is, put `"true"` as a value.

`debug_conditions` are evaluated in `dev` environment whereas `conditions` only in production.

Usage
-----

[](#usage)

Conditions are simple but powerful tool to restrict particular API, for example by origin IP, header, environment variable and so on. Check the [route conditions documentation](https://symfony.com/doc/current/routing/conditions.html)how to construct this stuff.

To extend this for your needs you can always create [`kernel.request`](https://symfony.com/doc/current/reference/events.html#kernel-request)event listener/subscriber and append some attributes to check against with expression. Be aware to configure your listener with priority higher than `32` because Symfony's router lives there. Executing your listener after would produce useless results.

### Swagger dump

[](#swagger-dump)

`bin/console swagger:api:export` is overrided — requires a single argument with desired API name to produce correct dump.

### Debug mode

[](#debug-mode)

If you are in development environment, it's useful to specify some conditions or use special request attribute to specify an API you want work with. It's enabled by default provided you're on development environment.

Just add `x-api-select` variable to one of [request parameters](https://symfony.com/doc/current/components/http_foundation.html#request)(except `files`) with specified API name and you're done. It will produce a cookie named with the same name that will allow to work with Swagger debugger.

Of course, it may be easily tweaked or disabled:

```
multi_api_platform:
  debug_http_listener:
    enabled: true
    request_param: x-api-select
    set_cookie: true
    request_order: ['request', 'query', 'attributes', 'cookies', 'headers', 'server']

```

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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 ~0 days

Total

2

Last Release

2679d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1813302?v=4)[Przemysław eRIZ Pawliczuk](/maintainers/er1z)[@er1z](https://github.com/er1z)

---

Top Contributors

[![er1z](https://avatars.githubusercontent.com/u/1813302?v=4)](https://github.com/er1z "er1z (7 commits)")

---

Tags

apiplatformpluginsymfony

### Embed Badge

![Health badge](/badges/er1z-multi-api-platform-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/er1z-multi-api-platform-bundle/health.svg)](https://phpackages.com/packages/er1z-multi-api-platform-bundle)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M49](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)

PHPackages © 2026

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