{"id":22056652,"url":"https://github.com/kevincobain2000/laravel-erd","last_synced_at":"2025-05-15T16:02:37.878Z","repository":{"id":45883126,"uuid":"389128134","full_name":"kevincobain2000/laravel-erd","owner":"kevincobain2000","description":"Automatically generate ERD Diagrams from Model's relations in Laravel","archived":false,"fork":false,"pushed_at":"2024-11-25T06:27:28.000Z","size":38,"stargazers_count":146,"open_issues_count":1,"forks_count":28,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-12T12:04:49.625Z","etag":null,"topics":["artisan","d3js","eloquent-models","entity-relationship-diagram","erd","gojs","laravel","laravel-package"],"latest_commit_sha":null,"homepage":"https://medium.com/web-developer/laravel-automatically-generate-interactive-erd-from-eloquent-relations-83fe65440716","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kevincobain2000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-24T15:09:25.000Z","updated_at":"2025-04-19T11:53:04.000Z","dependencies_parsed_at":"2024-06-18T22:47:27.919Z","dependency_job_id":"cfe97910-1817-4e40-9ebd-f57f1401e8ac","html_url":"https://github.com/kevincobain2000/laravel-erd","commit_stats":{"total_commits":19,"total_committers":5,"mean_commits":3.8,"dds":"0.21052631578947367","last_synced_commit":"c3cdb941977dee18518590de260df54525cbf985"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevincobain2000%2Flaravel-erd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevincobain2000%2Flaravel-erd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevincobain2000%2Flaravel-erd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevincobain2000%2Flaravel-erd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevincobain2000","download_url":"https://codeload.github.com/kevincobain2000/laravel-erd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254374398,"owners_count":22060609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artisan","d3js","eloquent-models","entity-relationship-diagram","erd","gojs","laravel","laravel-package"],"created_at":"2024-11-30T16:14:28.712Z","updated_at":"2025-05-15T16:02:37.824Z","avatar_url":"https://github.com/kevincobain2000.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel ERD Generator\n\nAutomatically generate interactive ERD from Models relationships in Laravel.\n- This package provides a CLI to automatically generate interactive ERD by looking into relationships setup inside Models.\n- The tool's interface is available to get JSON data of relationships and table schema from Models to be used by visual charts libraries of your choice such as d3.js etc\n- Output is an interactive ERD (Entity Relation Diagram) powered by HTML and JS (GOJS).\n\n\n| Lang    | Link                                                                                                                                   |\n| :------ | :------------------------------------------------------------------------------------------------------------------------------------- |\n| Details | [Medium Article](https://medium.com/web-developer/laravel-automatically-generate-interactive-erd-from-eloquent-relations-83fe65440716) |\n| Demo    | [Online Demo](https://kevincobain2000.github.io/laravel-blog/erd/)                                                                     |\n\n\n## Requirements\n\n| Lang    | Version    |\n| :------ | :--------- |\n| PHP     | 7.4 or 8.0 |\n| Laravel | 6.* or 8.* |\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require kevincobain2000/laravel-erd --dev\n```\n\n\nYou can publish the config file with:\n\n```bash\nphp artisan vendor:publish --provider=\"Kevincobain2000\\LaravelERD\\LaravelERDServiceProvider\"\n```\n\n## Usage\n\nYou can access the ERD in ``localhost:3000/erd``\n\nor generate a static HTML\n\n```php\nphp artisan erd:generate\n```\n\nERD HTML is generated inside ``docs/``.\n\n### Sample\n\n#### Screenshot\n\n![Image](https://i.imgur.com/tYk1CuC.png)\n\n#### Get JSON output\n\n```php\nuse Kevincobain2000\\LaravelERD\\LaravelERD;\n\n$modelsPath = base_path('app/Models');\n\n$laravelERD = new LaravelERD();\n$linkDataArray = $laravelERD-\u003egetLinkDataArray($modelsPath);\n$nodeDataArray = $laravelERD-\u003egetNodeDataArray($modelsPath);\n$erdData = json_encode(\n    [\n        \"link_data\" =\u003e $linkDataArray,\n        \"node_data\" =\u003e $nodeDataArray,\n    ],\n    JSON_PRETTY_PRINT\n);\nvar_dump($erdData);\n```\n\nSample JSON output\n\n```js\n{\n    \"link_data\": [\n        {\n            \"from\": \"comments\",\n            \"to\": \"users\",\n            \"fromText\": \"1..1\\nBT\",\n            \"toText\": \"\",\n            \"fromPort\": \"author_id\",\n            \"toPort\": \"id\",\n            \"type\": \"BelongsTo\"\n        },\n        {\n            \"from\": \"comments\",\n            \"to\": \"posts\",\n            \"fromText\": \"1..1\\nBT\",\n            \"toText\": \"\",\n            \"fromPort\": \"post_id\",\n            \"toPort\": \"id\",\n            \"type\": \"BelongsTo\"\n        },\n        ...\n        ...\n    ],\n    \"node_data\": [\n        {\n            \"key\": \"comments\",\n            \"schema\": [\n                {\n                    \"name\": \"id\",\n                    \"isKey\": true,\n                    \"figure\": \"Hexagon\",\n                    \"color\": \"#be4b15\",\n                    \"info\": \"integer\"\n                },\n                {\n                    \"name\": \"author_id\",\n                    \"isKey\": false,\n                    \"figure\": \"Decision\",\n                    \"color\": \"#6ea5f8\",\n                    \"info\": \"integer\"\n                },\n                ...\n                ...\n        }\n        ...\n    ]\n\n```\n\n## Testing\n\n```bash\n./vendor/bin/phpunit\n```\n\n## Changelog\n\n- Initial Release - POC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevincobain2000%2Flaravel-erd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevincobain2000%2Flaravel-erd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevincobain2000%2Flaravel-erd/lists"}