PHPackages                             drmmr763/laravel-asyncapi - 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. drmmr763/laravel-asyncapi

ActiveLibrary[API Development](/categories/api)

drmmr763/laravel-asyncapi
=========================

Laravel package for AsyncAPI 3.0.0 specification with annotations and code generation

v1.0.1(5mo ago)09[4 PRs](https://github.com/drmmr763/laravel-asyncapi/pulls)MITPHPPHP ^8.3CI passing

Since Nov 12Pushed 1mo agoCompare

[ Source](https://github.com/drmmr763/laravel-asyncapi)[ Packagist](https://packagist.org/packages/drmmr763/laravel-asyncapi)[ Docs](https://github.com/drmmr763/laravel-asyncapi)[ GitHub Sponsors](https://github.com/drmmr763)[ RSS](/packages/drmmr763-laravel-asyncapi/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (14)Versions (8)Used By (0)

Laravel package for AsyncAPI 3.0.0 specification with annotations and code generation
=====================================================================================

[](#laravel-package-for-asyncapi-300-specification-with-annotations-and-code-generation)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1c6b52f883bb6abaa1bed62079a846e0209da0c6dfd9a7da0a91e47d84c33d42/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64726d6d723736332f6c61726176656c2d6173796e636170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drmmr763/laravel-asyncapi)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b25909b83e49a3bd9738fa500464c10d8ddf9b09f95c099e035ba62f063bcff9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64726d6d723736332f6c61726176656c2d6173796e636170692f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/drmmr763/laravel-asyncapi/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/ee0ffbaa71b776d0d2f7d8ccfefd3885157c664e1565d60507837cb76586f317/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64726d6d723736332f6c61726176656c2d6173796e636170692f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/drmmr763/laravel-asyncapi/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/336c4fc6035c2ad4995499fb0ecd1b705686644ff890cdc985832fac10bfb30b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64726d6d723736332f6c61726176656c2d6173796e636170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/drmmr763/laravel-asyncapi)

A Laravel package that integrates [php-asyncapi-annotations](https://github.com/drmmr763/php-asyncapi-annotations) to provide AsyncAPI 3.0.0 specification generation using PHP 8.3+ attributes. This package allows you to define your AsyncAPI specifications directly in your Laravel code using attributes and generate specification files in JSON or YAML format.

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

[](#installation)

You can install the package via composer:

```
composer require drmmr763/laravel-asyncapi
```

You can publish the config file with:

```
php artisan vendor:publish --tag="asyncapi-config"
```

This is the contents of the published config file:

```
return [
    'version' => env('ASYNCAPI_VERSION', '3.0.0'),
    'default_content_type' => env('ASYNCAPI_DEFAULT_CONTENT_TYPE', 'application/json'),
    'scan_paths' => [
        app_path(),
    ],
    'output_path' => base_path('asyncapi'),
    'export_formats' => ['json', 'yaml'],
    'default_export_format' => env('ASYNCAPI_EXPORT_FORMAT', 'yaml'),
    'pretty_print' => env('ASYNCAPI_PRETTY_PRINT', true),
    'cache' => [
        'enabled' => env('ASYNCAPI_CACHE_ENABLED', true),
        'ttl' => env('ASYNCAPI_CACHE_TTL', 3600),
        'key' => 'asyncapi_annotations',
    ],
];
```

Usage
-----

[](#usage)

### Define AsyncAPI Specifications with Attributes

[](#define-asyncapi-specifications-with-attributes)

Use PHP 8.3+ attributes to define your AsyncAPI specifications directly in your code:

```
