Mermaid Diagrams
The diagram in your README (the one GitHub renders natively) is a valid input. Sketch your data model as a Mermaid diagram, or ask an AI assistant to produce one, and generate the API from it.
Usage
bash
php artisan make:fullapi --mermaid=blog.mmdWith a diagram like:
erDiagram
USER ||--o{ POST : writes
POST }o--o{ TAG : tagged
POST {
string title
text content
datetime deleted_at
}
TAG {
string name UK
}Rendered, that source is this data model, and the generated API matches it exactly:
What the parser understands
Both erDiagram and classDiagram are supported:
- Cardinalities (
||--o{,"1" --> "*") become the right Eloquent relations on both sides: the inverse and its FK column are synthesized - Compositions / aggregations (
*--,o--) becomehasMany UKmarkers become unique fields with the matching validation ruledeleted_atcolumns enable soft deletes (trait + restore/force-delete endpoints)- Markdown fences and comments are stripped: paste diagrams exactly as your AI assistant produced them
Design-first workflow
- Sketch the ER diagram in
docs/erd.mmd: GitHub renders it in the PR. - Review the diagram, not 40 files of generated code.
- Merge, then
php artisan make:fullapi --mermaid=docs/erd.mmd.
Since the diagram is the input itself, the architecture doc in your repo describes exactly what was generated from it.
