You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47-1Lines changed: 47 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,52 @@ Or use one of the other [output formats](https://www.graphviz.org/doc/info/outpu
84
84
php artisan generate:erd output.svg --format=svg
85
85
```
86
86
87
+
### Text Output
88
+
89
+
If you want to generate a text representation of the ER diagram instead of an image, you can use the `--text-output` option:
90
+
91
+
```bash
92
+
php artisan generate:erd output.txt --text-output
93
+
```
94
+
95
+
This will generate a text file with the GraphViz DOT representation of the ER diagram.
96
+
97
+
### Structured Text Output for AI Models
98
+
99
+
If you want to generate a structured text representation of the ER diagram that is more suitable for AI models, simply specify a filename with a `.txt` extension:
100
+
101
+
```bash
102
+
php artisan generate:erd output.txt
103
+
```
104
+
105
+
This will automatically generate a Markdown file with a structured representation of the entities and their relationships, which can be used as context for AI models.
106
+
107
+
#### Output Format
108
+
109
+
The structured output format looks like this:
110
+
111
+
```markdown
112
+
# Entity Relationship Diagram
113
+
114
+
## Entities
115
+
116
+
### User (`App\Models\User`)
117
+
118
+
#### Attributes:
119
+
- `id` (integer)
120
+
- `name` (string)
121
+
- `email` (string)
122
+
...
123
+
124
+
## Relationships
125
+
126
+
### User Relationships
127
+
- **HasMany** `posts` to Post (Local Key: `id`, Foreign Key: `user_id`)
128
+
...
129
+
```
130
+
131
+
This format is particularly useful when providing context to AI models about your database structure.
132
+
87
133
## Customization
88
134
89
135
Please take a look at the published `erd-generator.php` configuration file for all available customization options.
@@ -121,4 +167,4 @@ If you discover any security related issues, please email [email protected] ins
121
167
122
168
## License
123
169
124
-
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
170
+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
0 commit comments