Commands - ml-archive/nodes-php-api GitHub Wiki

The commands that are available will vary depending on which framework you're using. The following table shows the commands available and what framework they're available in.

Laravel Lumen
nodes:api:routes
nodes:api:cache
nodes:api:docs

nodes:api:routes

Only available in Laravel 5.1+

This command will generate a table list of your API routes. This command behaves in the exact same way as the route:list command available in Laravel. As well as the standard filtering available you also have the following filters: --versions and --scopes.

Examples
$ php artisan nodes:api:routes
$ php artisan nodes:api:routes --versions v1
$ php artisan nodes:api:routes --scopes read_user_data --scopes write_user_data

nodes:api:cache

Only available in Laravel 5.1+

This command will cache your API routes alongside the main application routes. When run this command will also run the route:cache command automatically, so do not run that command after running this command.

Your routes should either appear in the main app/Http/routes.php file or be included within that file for caching to take affect.

Examples
$ php artisan nodes:api:cache

nodes:api:docs

Available in both Laravel 5.1+ and Lumen 5.1+

This command will generate documentation from your annotated controllers into a standards compliant API Blueprint 1A document. For more on how to annotate your controllers see the API Blueprint Documentation chapter.

By default the command will output the generated documentation to stdout where you can pipe it to a file or push it to a server.

Examples
$ php artisan nodes:api:docs --name Example --use-version v2

Output directly to a file with --output-file.

$ php artisan nodes:api:docs --name Example --use-version v2 --output-file /path/to/documentation.md

To avoid defining the name and version manually, you can configure defaults in your configuration file or environment file. For more see the configuration chapter.

← API Blueprint Documentation