Download the PHP package wfgm5k2d/phplightdoc without Composer
On this page you can find all versions of the php package wfgm5k2d/phplightdoc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wfgm5k2d/phplightdoc
More information about wfgm5k2d/phplightdoc
Files in wfgm5k2d/phplightdoc
Package phplightdoc
Short Description Creating auto-documentation
License MIT
Homepage https://github.com/wfgm5k2d/php-light-doc
Informations about the package phplightdoc
Laravel API Documentation Generator
This package automatically analyzes Laravel controllers and routes, extracting information about groups, names, middleware, response codes, and generating user-friendly documentation in JSON format.
📦 Installation
📦 Publish all files
Configure environment variables
🚀 Usage
After installation, a command to generate documentation will appear in Laravel:
The documentation will be saved in the file specified in .env and will be available in the browser at the /doc route.
📝 Annotations and attributes
You can additionally annotate controllers and methods for a more accurate API description.
Controller Grouping
Groups help structure the documentation into thematic sections.
Simple grouping
You can give a name to a controller group. All routes of this controller will fall into the specified group.
Via comment:
Or attribute:
🆕 Advanced grouping (nested groups)
You can also create top-level groups to combine multiple controllers. To do this, you need to pass a second parameter to the DocGName attribute — the name of the main group.
Via attribute:
This allows you to create a more complex and convenient documentation structure.
Route Description
You can set a clear name for the route:
Via comment:
Or attribute:
Middleware Requirements
If a method requires authorization or special headers, specify it explicitly.
Via comment:
Or attribute:
By default, the following set of middleware is checked: auth, throttle, can, requires.
Response Codes
The package searches for response codes in these constructs:
By default, the response code will be 200 if no others are specified.
You can manually specify the available response codes if they are not detected
Via comment:
Or attribute:
🔄 Generating and viewing documentation
Run the generation command:
Open /doc in your browser to view.
How to develop the package locally?
-
Deploy a Laravel project locally. The last package build was on Laravel 12
-
Inside the project, create a
packagesfolder -
This is your packages directory. Add the
wfgm5k2dnamespace here - Clone the package code from the repository into it
- In the providers, connect the package provider
Laravel <= 10v.
- In the
config/app.phpfile, add the package provider to theprovidersarray
Laravel >= 11v.
-
In the
bootstrap/providers.phpfile, add the package provider to the array - In
composer.json, connect the package in the autoload section