1. Tennouji

    Tennouji Well-Known Member

    Mar 1, 2012
    The core issue I'm having isn't exclusively laravel-related, but since I just started learning laravel a few days ago I'm stating the framework just in case there already is a specific solution for this.

    What I'm trying to do is making direct relationships between entries in the same model.

    Next, I wanted is to have relationships to have a two-way reference between each entries. Reciprocally, if I remove the relationship in one entry, it should update and remove the reciprocal relationship the other entry had.

    Thirdly, I also want one Entry to be able to query all other indirect relationships it has, at multiple levels/layers.

    Finally, I wanted to have different types of these two-way direct relationship references.

    This concept isn't new since I'm actually trying to imitate AniDB's own relationship structure. I'm thinking that the direct relationships should be their own separate model and db tables, then I'll just query them in the entry model via a one-to-many relationship.

    The problem is I am having a difficult time on deciding about the structure it should have. I made this thread so that I can hear everyone else's suggestions/opinion about it.
  2. Tango

    Tango Super Moderator Staff Member

    Jul 9, 2009
  3. Tennouji

    Tennouji Well-Known Member

    Mar 1, 2012
    Thanks a lot for the link. I knew that I'll be needing to dive deeper into the relationships of models, but the illustrations in the link you provided is a huge help for me.
  4. Nenad__

    Nenad__ Well-Known Member

    Feb 10, 2011

Share This Page