Read the Article Here: Laravel2Doc - Generate Sequence Diagrams from Your Laravel Application in Seconds -
Automatically generate comprehensive documentation for Laravel applications, including Entity Relationship Diagrams (ERD), UML Class Diagrams, Sequence Diagrams, API Documentation, and more.
-
📊 Entity Relationship Diagrams (ERD): Visual representation of your database schema
-
📝 UML Class Diagrams: Object-oriented view of your models and their relationships
-
🔄 Sequence Diagrams: Flow of interactions between components
-
📚 API Documentation: Comprehensive documentation of your API endpoints
-
🚀 Interactive Interface: Browse all documentation through a user-friendly web interface
-
🔍 Automatic Analysis: No configuration needed - just install and run
npm install -g @priom7/laravel2doc
cd your-laravel-project
npm install @priom7/laravel2doc
Navigate to your Laravel project root directory and run:
npx laravel2doc
This will analyze your Laravel project and generate documentation in the laravel2doc
directory. It will also start a web server to view the documentation.
-p, --port <number>
: Port to serve documentation on (default: 3333)-o, --output <dir>
: Output directory (default: 'laravel2doc')
If you run Laravel2Doc outside a Laravel project, it will generate example documentation to demonstrate its features:
npx laravel2doc
Laravel2Doc generates the following documentation:
- Database tables with columns and data types
- Primary keys and foreign keys
- Relationships between tables
- Models with properties and methods
- Relationships between models
- Inheritance hierarchies
- Controller actions and their interactions
- Common operations like create, read, update, delete
- Flow of data between components
- Endpoints with HTTP methods
- Controller handlers and parameters
- Route definitions
Laravel2Doc analyzes your Laravel project by:
- Scanning model files to extract relationships and properties
- Analyzing migrations to build database schema
- Parsing controllers to understand application flow
- Examining route files to document API endpoints
- Generating interactive documentation with Mermaid diagrams
- Node.js 14+
- Laravel 8+ project (for Laravel-specific documentation)
Contributions are welcome! Please feel free to submit a Pull Request.
Created by priom7
- Md Sharif Alam