PHPackages                             saeedvir/laravel-project-markdown - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. saeedvir/laravel-project-markdown

ActiveLibrary[Database &amp; ORM](/categories/database)

saeedvir/laravel-project-markdown
=================================

Laravel package to generate comprehensive markdown documentation for project files and database schema with AI-readable output

1.0.0(7mo ago)1084↓50%MITPHPPHP ^8.1

Since Sep 20Pushed 7mo agoCompare

[ Source](https://github.com/saeedvir/laravel-project-markdown)[ Packagist](https://packagist.org/packages/saeedvir/laravel-project-markdown)[ Docs](https://github.com/saeedvir/laravel-project-markdown)[ RSS](/packages/saeedvir-laravel-project-markdown/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Laravel Project Markdown
========================

[](#laravel-project-markdown)

[![Latest Version](https://camo.githubusercontent.com/34e695c6016bc2a934a96bed696e29b2f2ab562a7134d65a55d00653cd506bea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e737667)](https://github.com/saeedvir/laravel-project-markdown)[![Laravel](https://camo.githubusercontent.com/36ab9eb40d419c375ec1c19e6d5fd0d5ae0aeb01372cc6b164966c412feecdad/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302532422d7265642e737667)](https://laravel.com)[![PHP](https://camo.githubusercontent.com/fb7c72456e13f7d5ecf8486e29d02a2e6775aaf4d18622a63529976b0ed0740e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d707572706c652e737667)](https://php.net)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

A comprehensive Laravel package that provides artisan commands to generate detailed markdown documentation for your project files and database schema. Perfect for developers, teams, and AI systems that need to understand your Laravel project structure.

🚀 Features
----------

[](#-features)

### 📁 Project Files Documentation

[](#-project-files-documentation)

- **Complete Project Structure**: Generate hierarchical tree view of your entire project
- **File Metadata**: Size, modification dates, and file types
- **Package Discovery**: Automatically detect Laravel packages and their providers/aliases
- **Version Information**: Laravel, PHP, and database version detection
- **Composer Analysis**: Parse and display all installed packages
- **Smart Filtering**: Exclude unnecessary directories and files
- **Dual Output**: Generate both human-readable Markdown and machine-readable JSON

### 🗄️ Database Documentation

[](#️-database-documentation)

- **Schema Analysis**: Complete database structure documentation
- **ER Diagrams**: Generate Mermaid diagrams for visual database relationships
- **Table Details**: Columns, types, constraints, indexes, and foreign keys
- **Relationship Mapping**: Visual connections between tables
- **Color-coded Tables**: Beautiful, organized database diagrams
- **Sample Data**: Include sample queries for better understanding
- **Multi-database Support**: MySQL, PostgreSQL, and SQLite

### 🤖 AI Readable Documentation

[](#-ai-readable-documentation)

- **Structured JSON Output**: Machine-readable format for AI systems
- **Comprehensive Metadata**: All project information in structured format
- **API Documentation**: Clear command signatures and options
- **Consistent Formatting**: Standardized output for AI processing
- **Version Tracking**: Complete version information for compatibility

📦 Installation
--------------

[](#-installation)

### Via Composer (Recommended)

[](#via-composer-recommended)

```
composer require saeedvir/laravel-project-markdown
```

### Local Development Installation

[](#local-development-installation)

1. **Add path repository** to your Laravel project's `composer.json`:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "../packages"
        }
    ],
    "require": {
        "saeedvir/laravel-project-markdown": "1.0.0"
    }
}
```

2. **Install the package**:

```
composer update
```

3. **Publish configuration** (optional):

```
php artisan vendor:publish --provider="Saeedvir\LaravelProjectMarkdown\LaravelProjectMarkdownServiceProvider" --tag="config"
```

⚙️ Configuration
----------------

[](#️-configuration)

The package includes a comprehensive configuration file at `config/laravel-project-markdown.php`:

```
return [
    'files' => [
        'exclude_directories' => [
            'vendor',
            'storage',
            'node_modules',
            'tests',
            '.git',
        ]
    ],
];
```

🎯 Usage
-------

[](#-usage)

### Project Files Documentation

[](#project-files-documentation)

Generate comprehensive documentation for your project files:

```
php artisan project:files-markdown
```

#### Command Options

[](#command-options)

OptionDescriptionDefault`path`Project path to analyze`base_path()``--output`Output markdown file path`storage/app/project-structure.md``--exclude`Additional directories to exclude`[]``--depth`Maximum directory depth`PHP_INT_MAX`#### Examples

[](#examples)

```
# Basic usage - analyze current project
php artisan project:files-markdown

# Analyze specific directory
php artisan project:files-markdown /path/to/project

# Custom output location
php artisan project:files-markdown --output=docs/project-overview.md

# Exclude specific directories
php artisan project:files-markdown --exclude=tests --exclude=storage

# Limit directory depth
php artisan project:files-markdown --depth=3
```

### Database Documentation

[](#database-documentation)

Generate comprehensive database schema documentation:

```
php artisan project:db-markdown
```

#### Command Options

[](#command-options-1)

OptionDescriptionDefault`--path`Output file path`database.md`#### Examples

[](#examples-1)

```
# Basic usage
php artisan project:db-markdown

# Custom output file
php artisan project:db-markdown --path=docs/database-schema.md
```

📊 Generated Documentation
-------------------------

[](#-generated-documentation)

### Files Documentation Output

[](#files-documentation-output)

The files documentation includes:

1. **Project Overview**

    - Project name and type
    - Generation timestamp
    - Version information (Laravel, PHP, Database)
2. **Composer Packages**

    - All installed packages with versions
    - Laravel discoverable packages
    - Service providers and aliases
3. **Project Structure**

    - Hierarchical file tree
    - File sizes and modification dates
    - Directory organization
4. **JSON Metadata**

    - Machine-readable project information
    - Complete package list
    - File structure data

### Database Documentation Output

[](#database-documentation-output)

The database documentation includes:

1. **Database Overview**

    - Database name and type
    - Version information
    - Generation timestamp
2. **ER Diagram**

    - Mermaid-compatible diagram
    - Color-coded tables
    - Relationship connections
3. **Table Details**

    - Column specifications
    - Data types and constraints
    - Indexes and foreign keys
    - Sample data queries
4. **JSON Schema**

    - Complete database structure
    - Relationship mappings
    - Metadata for AI processing

🤖 AI Readable Documentation
---------------------------

[](#-ai-readable-documentation-1)

This package is specifically designed to generate documentation that is both human-readable and AI-processable:

### Structured JSON Output

[](#structured-json-output)

Every command generates a corresponding JSON file with structured data:

```
{
    "project": "my-laravel-app",
    "type": "Laravel PHP Web Application",
    "generated": "2024-01-15 10:30:00",
    "versions": {
        "laravel": "10.0.0",
        "php": "8.1.0",
        "database": "MySQL 8.0.0"
    },
    "packages": [
        {
            "name": "laravel/framework",
            "version": "10.0.0"
        }
    ],
    "files": [
        {
            "type": "file",
            "path": "app/Http/Controllers/HomeController.php",
            "size": 1024,
            "modified": "2024-01-15 09:00"
        }
    ]
}
```

### AI Processing Benefits

[](#ai-processing-benefits)

- **Consistent Format**: Standardized JSON structure for easy parsing
- **Complete Metadata**: All project information in one place
- **Version Tracking**: Clear version information for compatibility
- **Relationship Data**: Database relationships in structured format
- **File Analysis**: Complete project structure for AI understanding

### Use Cases for AI Systems

[](#use-cases-for-ai-systems)

1. **Code Analysis**: AI can understand project structure and dependencies
2. **Documentation Generation**: Automated documentation creation
3. **Migration Planning**: Database schema analysis for migrations
4. **Dependency Management**: Package analysis and updates
5. **Project Onboarding**: Quick project understanding for new developers

🔧 Advanced Configuration
------------------------

[](#-advanced-configuration)

### Custom Exclude Patterns

[](#custom-exclude-patterns)

```
// config/laravel-project-markdown.php
'files' => [
    'exclude_directories' => [
        'vendor',
        'storage',
        'node_modules',
        'tests',
        '.git',
        'build',
        'dist',
        'coverage'
    ]
],
```

### Database Connection Settings

[](#database-connection-settings)

The database command automatically uses your Laravel database configuration. Ensure your `.env` file has proper database settings:

```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password
```

📋 Requirements
--------------

[](#-requirements)

- **PHP**: 8.1 or higher
- **Laravel**: 10.0 or higher
- **Database**: MySQL, PostgreSQL, or SQLite (for database documentation)

🧪 Testing
---------

[](#-testing)

Run the test suite:

```
composer test
# or
./vendor/bin/phpunit
```

📈 Examples
----------

[](#-examples)

### Example 1: Basic Project Analysis

[](#example-1-basic-project-analysis)

```
# Generate complete project documentation
php artisan project:files-markdown

# Output files:
# - storage/app/project-structure.md
# - storage/app/project-structure.json
```

### Example 2: Database Schema Documentation

[](#example-2-database-schema-documentation)

```
# Generate database documentation
php artisan project:db-markdown --path=docs/db-schema.md

# Output files:
# - storage/app/docs/db-schema.md
# - storage/app/docs/db-schema.json
```

### Example 3: Custom Analysis

[](#example-3-custom-analysis)

```
# Analyze specific directory with custom settings
php artisan project:files-markdown /path/to/project \
    --output=docs/custom-analysis.md \
    --exclude=tests \
    --exclude=storage \
    --depth=2
```

🤝 Contributing
--------------

[](#-contributing)

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

📝 Changelog
-----------

[](#-changelog)

### \[1.0.0\] - 2025-09-20

[](#100---2025-09-20)

#### Added

[](#added)

- Initial release of Laravel Project Markdown package
- `project:files-markdown` command for comprehensive project analysis
- `project:db-markdown` command for database schema documentation
- AI-readable JSON output for both commands
- Mermaid ER diagram generation
- Laravel package discovery and analysis
- Comprehensive configuration system
- Support for Laravel 10, 11, and 12
- Support for MySQL, PostgreSQL, and SQLite databases
- File structure tree visualization
- Database relationship mapping
- Sample data generation
- Customizable exclude/include patterns
- File content previews
- Database statistics and overview

#### Features

[](#features)

- **Dual Output**: Both Markdown and JSON formats
- **AI Integration**: Structured data for AI processing
- **Visual Diagrams**: Mermaid-compatible ER diagrams
- **Package Analysis**: Complete Composer package information
- **Version Detection**: Automatic version information gathering
- **Smart Filtering**: Configurable file and directory exclusions

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

👨‍💻 Author
----------

[](#‍-author)

**Saeedvir**

- Email:
- GitHub: [@saeedvir](https://github.com/saeedvir)

**Made with ❤️ for the Laravel community**

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance62

Regular maintenance activity

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

234d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb63dbbcce86ecd5af69b654e2d4a30ec7b9a7e19985accc6510413e04627cb2?d=identicon)[saeedvir](/maintainers/saeedvir)

---

Top Contributors

[![saeedvir](https://avatars.githubusercontent.com/u/8615309?v=4)](https://github.com/saeedvir "saeedvir (12 commits)")

---

Tags

laravelschemadatabasedocumentationartisanmarkdowncommandsproject-structuremermaiderdai-readable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/saeedvir-laravel-project-markdown/health.svg)

```
[![Health](https://phpackages.com/badges/saeedvir-laravel-project-markdown/health.svg)](https://phpackages.com/packages/saeedvir-laravel-project-markdown)
```

###  Alternatives

[toponepercent/baum

Baum is an implementation of the Nested Set pattern for Eloquent models.

3154.7k](/packages/toponepercent-baum)[dragon-code/laravel-data-dumper

Adding data from certain tables when executing the `php artisan schema:dump` console command

3418.6k](/packages/dragon-code-laravel-data-dumper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
