Relationships can be added from the Entity Options panel (you can open this panel by clicking on the Entity).
{info} Vemto will automatically generate the Foreign Keys, Pivot Tables, and the Inverse Relationship for created relationships. It is not necessary to create this kind of stuff manually (but you can do it if you want).
To add a new relationship, you can click on the Add Relationship button under the Entity Options. Then, just select the relationship type and the related model to show the type-specific relationship options.
A Belongs To relationship has the following options:
{info} After saving a "Belongs To" relationship, an inverse "Has Many" relationship will be automatically added to the related model.
A Has Many or Has One relationship has the following options:
{info} After saving a "Has Many" or "Has One" relationship, an inverse "Belongs To" relationship will be automatically added to the related model.
A Belongs To Many relationship has the following options:
{warning} Vemto will automatically suggest foreign names based on Laravel standards. If you are using a custom pivot table that doesn't follow the standards, it will be necessary to change the foreign names when creating the relationship
{info} After saving a Belongs To Many relationship, an inverse Belongs To Many relationship will be automatically added to the related model, and a Pivot Table, if necessary.
By default, Vemto automatically generates Pivot Tables when adding a Belongs To Many relationship. So, it is highly recommended to let Vemto take care of it.
But, if you want to add these pivot tables manually, please be sure to follow the Laravel Many to Many Relationships conventions to make sure these tables work well with the Eloquent ORM.