Declaring hasMany() implies belongsTo() declaration on the other side?


In a model A I declared a hasMany() relationship with a model B.

Does this imply that I must declare a belongsTo() relationship in B ?


In short, no. It’s not mandatory but makes logical sense.


Hey @begueradj! :wave:

No need to define the relation on both models if you will use it only one-way.

There’s a note on this in the documentation.