PHPackages                             victormgomes/async-api - 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. victormgomes/async-api

ActiveLibrary[API Development](/categories/api)

victormgomes/async-api
======================

Automatically generate documentation for the AsyncAPI specification based on Laravel events

1.0.0(2w ago)2132↓16.7%[1 PRs](https://github.com/VictorMGomes/async-api/pulls)MITPHPPHP ^8.4CI passing

Since Apr 25Pushed 2w agoCompare

[ Source](https://github.com/VictorMGomes/async-api)[ Packagist](https://packagist.org/packages/victormgomes/async-api)[ Docs](https://github.com/victormgomes/async-api)[ GitHub Sponsors](https://github.com/sponsors/VictorMGomes)[ RSS](/packages/victormgomes-async-api/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (6)Dependencies (18)Versions (8)Used By (0)

Async API
=========

[](#async-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7e51c272e3b89e1e71d5201e117414f277d418fa63c9b3333df0b8599b79c18b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766963746f726d676f6d65732f6173796e632d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/victormgomes/async-api)[![GitHub Tests Action Status](https://camo.githubusercontent.com/d53361ebe1d5a401c70dfc990d3f0feae385a1d4cefd538fd5f6cc0b32baca33/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f766963746f726d676f6d65732f6173796e632d6170692f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/victormgomes/async-api/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/51fb68aaf0dd2ea085c847628041d265dc0f6f9ba89f16579cb77cf82bba0a26/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f766963746f726d676f6d65732f6173796e632d6170692f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/victormgomes/async-api/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/4f7536e5c0c2da5f87b7e1d6d5bc4232b6d3cc5bb10f89b6df975932b31e32fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766963746f726d676f6d65732f6173796e632d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/victormgomes/async-api)[![License](https://camo.githubusercontent.com/5b82596357b60dd720f62c0c52473eb65d96d878fe101500ff8aa12f508729d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f766963746f726d676f6d65732f6173796e632d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/victormgomes/async-api)

**Automatically generate documentation for the AsyncAPI specification based on Laravel events**

---

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

[](#introduction)

In modern event-driven architectures, documenting WebSocket interfaces is as crucial as documenting REST APIs. **Async-API** bridges this gap for Laravel applications by automating the generation of AsyncAPI specifications.

### Why use this package?

[](#why-use-this-package)

- **Zero-Effort Documentation**: Stop maintaining manual AsyncAPI files. Document your events directly in your PHP code.
- **Attribute-Based**: Uses modern PHP 8 attributes for a clean and declarative developer experience.
- **Schema Integration**: Automatically extracts payload schemas from DTOs or models, ensuring your documentation always matches your code.
- **Seamless Integration**: Works perfectly with Laravel's broadcasting system.

---

Support us
----------

[](#support-us)

We invest a lot of resources into creating [best in class open source packages](https://github.com/victormgomes). You can support us by [sponsoring us on GitHub](https://github.com/sponsors/VictorMGomes).

---

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

[](#installation)

You can install the package via composer:

```
composer require victormgomes/async-api
```

You can publish the config file with:

```
php artisan vendor:publish --tag="async-api-config"
```

---

Usage
-----

[](#usage)

Simply add the `#[AsyncApi]` attribute to your event classes. You can specify a DTO class to automatically generate the schema for the message payload.

```
use Victormgomes\AsyncApi\Attributes\AsyncApi;

#[AsyncApi(dto: ChatPresenceDTO::class)]
class ChatPresence implements ShouldBroadcast
{
    // ...
}
```

The package will then discover these attributes and compile them into a standardized AsyncAPI specification.

---

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Victor M. Gomes](https://github.com/VictorMGomes)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance97

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

Total

6

Last Release

15d ago

Major Versions

0.0.5 → 1.0.02026-05-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20375480?v=4)[Victor M. Gomes](/maintainers/victormgomes)[@VictorMGomes](https://github.com/VictorMGomes)

---

Top Contributors

[![VictorMGomes](https://avatars.githubusercontent.com/u/20375480?v=4)](https://github.com/VictorMGomes "VictorMGomes (15 commits)")

---

Tags

laravelasync apiVictor M. Gomes

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/victormgomes-async-api/health.svg)

```
[![Health](https://phpackages.com/badges/victormgomes-async-api/health.svg)](https://phpackages.com/packages/victormgomes-async-api)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[moonshine/moonshine

Laravel administration panel

1.3k239.9k72](/packages/moonshine-moonshine)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9732.3M121](/packages/roots-acorn)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

76318.2M110](/packages/laravel-mcp)[laravel/folio

Page based routing for Laravel.

603526.4k30](/packages/laravel-folio)

PHPackages © 2026

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