I have 3 tables posts, comments and likes. One post can have multiple comments and one comments can have multiple likes. How can I define relationship between 3 tables to fetch all posts details, including comments and likes of particular post_id in laravel 5.1?
Tables in DB
-
posts
- post_id
- post_detail
-
comments
- comment_id
- post_id
- comment
-
likes
- like_id
- comment_id
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire