Home » Php » php – Get data from a array in laravel

php – Get data from a array in laravel

Posted by: admin February 25, 2020 Leave a comment

Questions:

I have two tables as Comment and Reply in my DB.
If a user puts a comment and another user can reply to that comment.

there are many replies to one comment and reply has one comment.

if comments and replies related to each other(they combine with comment id and reply id), send from the frontend as an array object how do I catch comments and replies related to each other and send them simultaneously to DB through an API in lareval.

comments and replies are added like below.

enter image description here

How to&Answers: