Upgrading
Upgrading To 2.0.0 From 1.x
Version 2.0.0 introduces automated static analysis and brings some breaking changes to the configuration and routes.
1. Routes Renamed
The documentation viewer routes have been renamed to better reflect Laravel's broadcasting terminology:
/docs/wsis now/docs/broadcast/docs/ws/jsonis now/docs/broadcast/json
If you have any custom links or bookmarks to the documentation, make sure to update them.
2. Configuration Structure Flattened
The configuration file config/async-api.php has been simplified and flattened.
If you previously published the configuration file, you must publish the new version and migrate your settings:
php artisan vendor:publish --tag="async-api-config" --forceKey changes in the config structure:
- The
serverarray has been flattened intoserver_url,server_description, andserver_protocol. - The
infoarray has been flattened intoinfo_title,info_version, andinfo_description. - Added a
debugoption.
3. Automated Schema Discovery (Plug-and-Play)
The #[AsyncApi] attribute is now completely optional!
You no longer need to add #[AsyncApi] to your events. The package will automatically scan any class implementing ShouldBroadcast and infer its schema via static code analysis.
You can safely remove the #[AsyncApi] attribute from your events unless you need to override specific information (like a custom channel name or description).