1 year ago

Confused on eloquent relationship

Posted 1 year ago by oroalej

Hi all,

I'm confused on where to place the HasMany or BelongsTo in the model.

I have a table named department and directory, department can have multiple directory but directory can only have one department. I placed the foreign key in directory table. Now where do I place the belongsTo or hasMany?

I read an explanation in here regarding this where he use a head and a brain as an example but i cannot find it anymore.

Please sign in or create an account to participate in this conversation.