Laravel Diagram Generator

时间:2019-03-06 11:41:50

标签: laravel

I am facing a problem dealing with Laravel database and model.

I am working on an existing laravel project with contains only models (no migrations)

I wanted to generate a database from models but till now I could not find any solution, so I thought of diagram generator in Laravel to help me generate the tables of the database so I could know the columns of the tables but I did it work. when I tap the command : php artisan generate:erd it won't work.

The error is:

"There are no commands defined in the "generate" namespace."

1 个答案:

答案 0 :(得分:0)

首先,您不能直接使用此命令php artisan generate:erd 您尚未安装软件包,这就是导致此错误的原因:

  

“生成”名称空间中未定义任何命令。


首先,您需要通过composer安装Laravel ER Diagram Generator软件包:

composer require beyondcode/laravel-er-diagram-generator --dev

然后,您可以使用提供的artisan命令生成实体关系图:php artisan generate:erd这将生成一个名为graph.png.的文件