Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sroze/api-platform-messenger

Uses API Platform to exposes Commands & Queries dispatched to your Symfony Messenger bus
https://github.com/sroze/api-platform-messenger

api-platform symfony symfony-bundle symfony-messenger

Last synced: 20 days ago
JSON representation

Uses API Platform to exposes Commands & Queries dispatched to your Symfony Messenger bus

Awesome Lists containing this project

README

        

# Symfony Messenger & API Platform integration

Using a message bus like [Symfony Messenger](https://symfony.com/doc/current/messenger.html) is a wonderful way of structuring
your application around commands or queries (which will _just_ be PHP classes). [API Platform](https://api-platform.com/) is
a great framework to expose APIs.

The point of this bridge is to enable you to build business actions-centric APIs instead of CRUD APIs. [Check this very simple example](https://github.com/sroze/api-platform-messenger-example).

**Note:** This is still an experimentation. You will likely have to contribute to make it fit your needs. Looking forward to review your pull-requests!

## Usage

1. Get an API Platform application. Easiest is to use Symfony's `api` pack:
```bash
composer create-project symfony/skeleton api-platform-and-messenger && \
cd api-platform-and-messenger && \
composer req api
```

2. Install this bridge
```bash
composer req sroze/api-platform-messenger:dev-master
```

3. Configure your message(s) to be handled by API Platform like in the following example:
```php