Consider two models A and B
A
B
A -> relatedTo B is a one to one relationship
one to one
What is the differ
Main difference is as below:
belongsTo and belongsToMany - you're telling Laravel that this table holds the foreign key that connects it to the other table.
belongsTo
belongsToMany
hasOne and hasMany - you're telling Laravel that this table does not have the foreign key.
hasOne
hasMany