api-docs and doctum API Generation
Table of contents
1. Overview Table of Contents
We use doctum to generate documentation based on phpdoc comments for describing classes and functions. The views for this frameworkâs api-docs can be found at resources/views/api-docs
. The api-docs are accessible locally through the API link in the navbar if you are logged in as an administrator. Whenever you add more functions to your project the api-docs can be easily be generated by running the following command:
php console make:api
Make sure you use git to add and commit your api-docs so they are under source control for your project.
The configuration file is located under project root and is called doctum.php
. The following directories are excluded from being included with api-docs:
- resoruces/views/api-docs
- cache
- config
- logs
- node_modules
- public
- vendor
2. Accessing api-docs Table of Contents
There are two methods for accessing the api-docs. Running the following command in the console with optional port and host arguments:
php console serve:api --port=<port_number> --host=<hostname_or_ip>
Then navigate to http://<hostname_or_ip>:<port_number>
. The default is http://localhost:8001
. If you are using Apache or Nginx you can navigate to localhost/api-docs/index.html
.