Automatically generates AsyncAPI 3.0 documentation from your Laravel broadcasting implementations.
In modern event-driven architectures, documenting broadcast events is as
crucial as documenting REST APIs. laravel-async-api bridges this gap for
Laravel applications by automating the generation of AsyncAPI specifications.
It empowers you to document your broadcast events and generates fully compliant AsyncAPI 3.0 specifications with zero manual effort.
- Zero-Effort Documentation: Stop maintaining manual AsyncAPI files. Your events are documented automatically.
- Schema Integration: The broadcasting implementation structure, including data types, is inferred automatically to ensure your documentation always matches your code.
- Seamless Integration: Works perfectly with Laravel's broadcasting system (Reverb, Pusher, Soketi).
- AsyncAPI 3.0 Compliant: Generates specifications that follow the latest AsyncAPI standard.
- AI Agent Ready: Includes an official Laravel Boost skill to automatically teach AI agents (like Claude Code and Cursor) how to use this package in your project.
The package automatically discovers any event class in your application that implements ShouldBroadcast.
class ChatMessage implements ShouldBroadcast
{
// ...
}By simply implementing ShouldBroadcast, your event is instantly documented. The package uses static code analysis to automatically infer the payload schema directly from your properties, arrays, generics, and PHPDocs without requiring any manual reflection or hints!
Install the package via Composer:
composer require victormgomes/async-apiIf you need to customize the default settings (like server host, port, or title), publish the config file:
php artisan vendor:publish --tag="async-api-config"Visit http://localhost/docs/broadcast in your application to view the interactive AsyncAPI
documentation. The raw JSON specification is also available at http://localhost/docs/broadcast/json.
For a deep dive into the features, please read the Official Documentation.
If you find this package useful in your day-to-day development, please consider sponsoring my work or leaving a ⭐ on the repository. Your support directly helps keep this project actively maintained and free!
The MIT License (MIT). Please see License File for more information.