laravel-er-diagram-generator
laravel-er-diagram-generator copied to clipboard
Freezing on a Particular Model
▶ php artisan generate:erd
Found 43 models.
Inspecting model relations.
38/43 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░] 88%
Is there a way to provide more robust progress so I can see what model is causing this to stall? Using the -vvv switch just shows the data rates.
Same problem. Mine freezes on number 14/15
$ php artisan generate:erd -vvv
Found 15 models.
Inspecting model relations.
14/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░] 93% < 1 sec/< 1 sec 28.0 MiB
dump()
-ing the model inside the $models->transform()
gave more useful output
In GenerateDiagramCommand.php
$models->transform(function ($model) use ($bar) {
$bar->advance();
dump($model); // <------ DUMPING
return new GraphModel(
$model,
(new ReflectionClass($model))->getShortName(),
$this->relationFinder->getModelRelations($model)
);
});
Output
$ php artisan generate:erd -vvv
Found 15 models.
Inspecting model relations.
1/15 [▓░░░░░░░░░░░░░░░░░░░░░░░░░░░] 6% < 1 sec/< 1 sec 26.0 MiB"App\Models\Project"
2/15 [▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░] 13% < 1 sec/< 1 sec 28.0 MiB"App\Models\ContactPerson"
3/15 [▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░] 20% < 1 sec/< 1 sec 28.0 MiB"App\Models\Checklist"
4/15 [▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░] 26% < 1 sec/< 1 sec 28.0 MiB"App\Models\Procedure"
5/15 [▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░] 33% < 1 sec/< 1 sec 28.0 MiB"App\Models\Checkpoint"
6/15 [▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░] 40% < 1 sec/< 1 sec 28.0 MiB"App\Models\Employee"
7/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░] 46% < 1 sec/< 1 sec 28.0 MiB"App\Models\EmployeeDetails"
8/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░] 53% < 1 sec/< 1 sec 28.0 MiB"App\Models\User"
9/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░] 60% < 1 sec/< 1 sec 30.0 MiB"App\Models\ProjectNonMember"
10/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░] 66% < 1 sec/< 1 sec 30.0 MiB"App\Models\ProjectTemplate"
11/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░] 73% < 1 sec/< 1 sec 30.0 MiB"App\Models\Contact"
12/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░] 80% < 1 sec/< 1 sec 30.0 MiB"App\Models\Industry"
13/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░] 86% < 1 sec/< 1 sec 30.0 MiB"App\Models\Company"
14/15 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░] 93% < 1 sec/< 1 sec 30.0 MiB"App\Models\Model"
This is awesome. I would argue this should be the default.
I have the same problem. Now that I have this output I see it stalls on one model for 4 minutes, then another for 13 minutes. What does this mean that it gets stuck for so long on such a model? should I be looking for a possible infinite loop of relationships?