title: Can this block of code of mine can be improved
body: <p>[This is to populate data from two tables that one has two foreign keys from the same column as reference on the other table]</p>
  <p><a href="https://i.stack.imgur.com/D8fiv.png" rel="nofollow noreferrer">https://i.stack.imgur.com/D8fiv.png</a></p>
  <p>[This is my schema for the table with the foreign key]</p>
  <p><a href="https://i.stack.imgur.com/eYDL0.png" rel="nofollow noreferrer">https://i.stack.imgur.com/eYDL0.png</a></p>
  <p>This is written in laravel and it is working however i have an itchy feeling that this is wrong</p>