comment:Array(2)
0:{id: 1, user_id: 10, answer_id: 6, comment_content: "This is first comment ever in this", parent_id: 0, …}
1:{id: 6, user_id: 10, answer_id: 6, comment_content: "This is commenting again let's see whether it works or not, It should work.", parent_id: 0, …}
我得到一个对象数组...... 假设我有三个雄辩的模型评论和用户,答案。我只是展示了两条属于答案的评论。我还想显示与每条评论关联的用户,因为您可以看到有一个user_id是外键
我想使用雄辩的方式得到类似的东西...我如何使用追加方法
comment:Array(2)
0:{id: 1, user_id: 10, name: "Jonh Doe" email: 'john@xyz.com', answer_id: 6, comment_content: "This is first comment ever in this", parent_id: 0, …}
1:{id: 6, user_id: 10, name: "Foo", email:'foo@xyz.com', answer_id: 6, comment_content: "This is commenting again let's see whether it works or not, It should work.", parent_id: 0, …}