I am currently learning Laravel, and I have a query regarding the best practice for creating entity relationships whilst writing a migration as I am confused as to how best do this.
Lets say you are writing an entity schema that you know will have a Many to Many relationship or a One to Many relationship or even a foreign key, etc.
Are you meant to code the relationship into the migration itself, or after it?
All the tutorials I've seen up to now seem to gloss over how to make the migration know that Entity A will have relationship with Entity B and put the relationships in the models using hasMany(), etc
This confuses me, are you meant to put the relationship structure into the migration; or is it better to create your migration and then make your relationship in the model?
Thanks now