Erlyc Erlyc

Models tab

What this screen does

The Models tab maps your entities onto Eloquent models: one model per entity with its attributes, plus the relation methods (hasMany, belongsTo, belongsToMany…) both sides of every relationship need. This is the last stop before actual code, and the place to fine-tune naming.

Typical workflow

  1. Click Generate Models to derive models from the current entity diagram.
  2. Review each model card: attributes, casts, and the relations it carries.
  3. Edit Model to adjust a model's details; Add / Edit / Delete Relation to correct a relation the derivation got wrong or to add one the diagram does not express.
  4. When the models read correctly, move on to the Laravel tab — the generated code follows what you approved here.

Examples & tips

  • Relation names matter in generated code: $order->customer reads well, $order->user2 does not. Rename here rather than in the generated files.
  • Both sides of a relationship should exist — an Order that belongsTo a Customer implies the Customer hasMany Orders. The generator pairs them, but review after manual edits.
  • As with the Database tab, structural problems are best fixed upstream on the Entities tab and regenerated; manual work here is for naming and additions, not repairs.