kevincobain2000 / laravel-erd

Automatically generate ERD Diagrams from Model's relations in Laravel
https://medium.com/web-developer/laravel-automatically-generate-interactive-erd-from-eloquent-relations-83fe65440716
138 stars 25 forks source link

How to use the generator with modular folder structure #9

Closed allanvb closed 2 years ago

allanvb commented 2 years ago

The project I try to generate the diagram for is using the modular folder structure.

├── app
│   ├── Modules
│   │   ├── Module1
│   │   │   ├── Models
│   │   │   │   ├── ModuleOneModelOne.php
│   │   │   │   └── ModuleOneModelTwo.php

How can I configure the package in the way to retrieve the models from this stucture ? Thank you in advance.

koshuang commented 2 years ago

@allanvb you can confirm that PR #10 works

{
    "repositories": [
        {
            "url": "https://github.com/koshuang/laravel-erd",
            "type": "github"
        }
    ],
    "require": {
        "kevincobain2000/laravel-erd": "dev-master"
   }
}

So you can set the models path to glob syntax in config/laravel-erd.php.

'models_path'      => base_path('app/Modules/*/Models'),
kevincobain2000 commented 2 years ago

Merged https://github.com/kevincobain2000/laravel-erd/releases/tag/1.3 Thanks @koshuang