Skip to content

Automatically generate comprehensive documentation for Laravel applications, including Entity Relationship Diagrams (ERD), UML Class Diagrams, Sequence Diagrams, API Documentation, and more.

License

Notifications You must be signed in to change notification settings

Priom7/laravel2doc

Repository files navigation

Laravel2Doc (Live Now — May 2025)

npm version npm downloads License: MIT Node.js Made by priom7

Automatically generate beautiful, interactive documentation for Laravel projects in seconds.


⭐ Feel free to leave a star and follow for updates!

📣 Feedback is always welcome — suggest features you'd like to see!

📖 Read the article:
Read Article


✨ Features

  • 📊 ERD — Entity Relationship Diagrams
  • 📝 UML — Class Diagrams for Models
  • 🔄 Sequence Diagrams — Component interaction flows
  • 📚 API Docs — Endpoints, controllers, routes
  • 🚀 Interactive Viewer — Browse via built-in web interface
  • 🔍 Zero Config — Auto-analyzes Laravel project structure

📦 Installation

Global:

npm install -g @priom7/laravel2doc

Local (within a Laravel project):

cd your-laravel-project
npm install @priom7/laravel2doc

🚀 Usage

Inside your Laravel project:

npx laravel2doc

This generates documentation in the laravel2doc/ folder and launches a web viewer.

⚙️ Options

Flag Description Default
-p, --port <num> Port for local server 3333
-o, --output <dir> Directory to output documentation laravel2doc

🧪 Demo Mode

Try it outside a Laravel project to see a live example:

npx laravel2doc

🧾 Generated Documentation

📊 Entity Relationship Diagram (ERD)

  • Tables, columns, data types
  • Primary/foreign keys, relationships
ERD Sample

🏗 UML Class Diagram

  • Model properties, methods
  • Relationships and inheritance
UML Sample

🔄 Sequence Diagrams

  • Controller method flows
  • CRUD interaction flow
Sequence Sample

🌐 API Documentation

  • Routes, HTTP methods, controllers
  • Parameter and handler mappings
API Sample

🧠 How It Works

  1. Scans Laravel models for relationships and attributes
  2. Parses migrations to reconstruct DB schema
  3. Analyzes controllers and route files
  4. Generates Mermaid-based diagrams and structured API docs
  5. Serves everything via a local web interface

🛠 Requirements

  • Node.js 14+
  • Laravel 8+ project

🤝 Contributing

Contributions are welcome! Feel free to submit a pull request or feature request.


👨‍💻 Author

Created by @priom7 Md Sharif Alam


🌟 Found it useful? Give it a ⭐ on GitHub and share with Laravel developers!

About

Automatically generate comprehensive documentation for Laravel applications, including Entity Relationship Diagrams (ERD), UML Class Diagrams, Sequence Diagrams, API Documentation, and more.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published