Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Async API

Automatically generates AsyncAPI 3.0 documentation from your Laravel broadcasting implementations.

Package Status

Latest Version on Packagist Total Downloads License

PHP Versions Laravel Versions

Tests Status Code Style Status Code Quality Status

Why Use It?

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.

Features

  • 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.

How It Works

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!


🚀 Quick Start

Step 1: Installation

Install the package via Composer:

composer require victormgomes/async-api

Step 2: Publish the Configuration (Optional)

If 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"

Step 3: Access the Documentation

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.


Documentation

For a deep dive into the features, please read the Official Documentation.


Credits

Support Us

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!


Community & Guidelines


License

The MIT License (MIT). Please see License File for more information.