distant relationship with laravel

4

I have this table structure and would like to know if the person who posted the thread or the reply member or moderator in> but I could not structure a relationship that works, can anyone help me?

forum
      id - integer
      name - string

users
     id - integer
     name - string

threads
     id - integer
     user_id - integer
     communitie_id - integer
     title - string
     body - text

 replies 
     id - integer     
     thread_id - integer    
     author_id - integer    
     title - string    
     body - text

 forum_user
     forum_id - integer
     user_id - integer 
     type - moderator/member/owner
    
asked by anonymous 16.08.2014 / 23:02

1 answer

1

Maybe you can use the Triple Pivot library.

See here the link and some examples:

link

    
12.08.2015 / 17:57