export_laravel_models
Generate Laravel Eloquent model classes from a DBML diagram, including fillable fields, casts, and inferred relationships. Export models for a saved diagram or unsaved DBML text.
Instructions
Generate Laravel Eloquent model files (fillable, casts, and inferred relationships including belongsToMany through plain pivot tables) for a diagram.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "export_laravel_models"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| diagram_id | No | A saved diagram to export (its UUID). | |
| dbml_source | No | Or export unsaved DBML text directly instead of a saved diagram. | |
| laravel_version | No | Target Laravel major version. 10 emits the legacy `protected $casts` property; 11+ emits the newer `casts(): array` method (not recognized by Eloquent 10). |