dimanche 29 novembre 2015

Laraval 5.1 HasMany Relationship Issue

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

  1. posts

    • post_id
    • post_detail
  2. comments

    • comment_id
    • post_id
    • comment
  3. likes

    • like_id
    • comment_id


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire