Exporting specification

You can export the resulting documentation (OpenAPI 3.1.0) using the scramble:export command:

php artisan scramble:export

This will create an api.json file containing the specification of the default API in the application’s root folder. You can customize the file path and name by providing the --path option. For example, to save the file in public/api.json:

php artisan scramble:export --path=public/api.json

If you have registered an API other than default, you can specify the API using the --api option:

php artisan scramble:export --api=v2
Scramble PRO
Comprehensive API documentation generation for Spatie’s Laravel Data, Laravel Query Builder, and other packages.